[Seaside] How to add GLORP to a Seaside application?

Martin J.Laubach mjl at laubach.at
Tue Feb 1 02:03:59 CET 2005


   I'm afraid I painted myself in yet another corner with GLORP and 
Seaside.

   The problem is that glorp does not support nesting of UnitOfWorks.
That, together with the highly dynamic behaviour of Seaside 
applications,
leads to my losing much hair...


   Consider for example a navigation bar with two links, each leading to
an editing pane for some database object. On each I have something like

	MyEditingPane>>renderContentOn: html
		session beginUnitOfWork.
		(self confirm: 'Do you want to save that?')
			ifTrue: [ s commitUnitOfWork ]
			ifFalse: [ s rollbackUnitOfWork ]


   Now when the user changes to the other editor pane while the #confirm:
is displayed, *boom*, glorp throws an exception. The only way I see out
of that is to use UnitOfWorks only when it can't be preempted by the 
user.
But then, don't I lose all the benefits (like in the example above, 
being
able to roll back easily)?

   My real example is a bit more complicated, so I can't just move the
#beginUnitOfWork after the confirm as it's doing the modifications in
a #call'ed subcomponent and returns true/false depending on the user
hitting a save or revert button.

   Wrong approach to that problem?

	mjl




More information about the Seaside mailing list