Hi,
David Jencks:
> I don't think I understand what you are suggesting. However...
Just as a reminder, my suggestions for mimicked optimistic
locking was:
generate SQL for update/delete with a where clause not only
using the primary key fields, but also the old values of changed
fields / all fields; then interpret a '0 rows affected' response
from executeUpdate() as "you're to late, you must rollback" and
throw an Exception.
> Are you familiar with the lock-free versioning/ optimistic
> locking scheme used in interbase/firebird?
>
> transactions are numbered sequentially when they are started.
I know, someone mentioned it before. Interbase does that at the
database level, I assume, no need to have the TX ID in the EJB
server/container/bean? My suggestion is meant for DB's, that don't
have native optimistic locking support (and only mimickes OL, see
one of my last mails with the diagram, showing pitfalls).
I also originally considered 'versioning', but this whould require
a persistet version number in every table, possibly not a good
option for existing DB's or tables with very few columns and very
much rows, because of the size overhead.
> you get an immediate exception
>
> or
>
> your changes block until the other guy commits (you get an
> exception) or rolls back (your transaction succeeds)
As you may have seen from the diagram already, the first option
is impossible with my approach due to the DB really locking on
updates, it ever behaves as with the second option above.
> I think you could use a scheme like this at least with commit
> option A.
Hmmm, I'm still unsure, if commit option A, multiple instances
and locking play nicely together, need more time to consider
different scenarios, I already said, I'm too slow thinking :-)
Thanks and regards
Georg
___ ___
| + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg
|_|_\ |___ [EMAIL PROTECTED] +49 (40) 23 53 27 10
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development