Automatic update abortTransaction in JADE 5
Posted: Fri Aug 07, 2009 11:43 am
by Eric Peachey >> Mon, 6 Sep 1999 1:23:26 GMT
Hello,
An interesting new feature of JADE 5 is that should an exception occur whilst doing an automatic update, JADE aborts the transaction before control is passed back to your excetpion handler. This quite different to the behavoiur of JADE in previous releases - the online help doesn't seem to have caught up yet.
The new behaviour means that code that used to handle such exceptions (e.g. say a duplicate key when loading data from a file) may not work anymore. It may also mean that if you created say 100 objects per transaction and the exception is detected on the last one then all the previous objects will be rolled out. So, this means we're back to doing stuff like 'if myCollection.includesKey( something.key ) = false then create object....', instead of being able to handle the exception ourselves.
I understand that this behaviour was changed because developers weren't handling things correctly so the inverses between objects was not set properly. (This is third hand so don't take it as gospel.)
What do you others think?
Eric in Dunedin
Hello,
An interesting new feature of JADE 5 is that should an exception occur whilst doing an automatic update, JADE aborts the transaction before control is passed back to your excetpion handler. This quite different to the behavoiur of JADE in previous releases - the online help doesn't seem to have caught up yet.
The new behaviour means that code that used to handle such exceptions (e.g. say a duplicate key when loading data from a file) may not work anymore. It may also mean that if you created say 100 objects per transaction and the exception is detected on the last one then all the previous objects will be rolled out. So, this means we're back to doing stuff like 'if myCollection.includesKey( something.key ) = false then create object....', instead of being able to handle the exception ourselves.
I understand that this behaviour was changed because developers weren't handling things correctly so the inverses between objects was not set properly. (This is third hand so don't take it as gospel.)
What do you others think?
Eric in Dunedin