Hi,

> If h2 detects a deadlock it tries to rollback the transaction where
> deadlock was first encountered.
> Does it try to run that transaction once the conflicting transaction has
> finished (in the confines of the timeout period)?

No, it does not.

> This way it could automatically fix most deadlocks.

May be, but there are a lot of situations when this behavior is not
desireable and better to handle such errors on the application level.
The best way is to try to avoid deadlocks at all if it is possible by
modifying tables in all transactions always in the same order.

> The reason why I am pondering this is that when a deadlock is
> encountered in a trigger, h2 tries to do the rollback but because
> rollback is not allowed within a trigger it throws an exception telling
> user that rollback is not allowed within a trigger.
>
> The clear problem here is that the real issue (deadlock) is lost in the
> exception handling.

Yes, looks like a bug.

regards,
Sergi

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to