On Sat, 7 Apr 2007, Thoralf Rickert wrote:
3)Torque does not contain built-in help for version checking. As a
result, this feature will require a custom implementation for future
enhancements.
I do not understand what that means. Could you explain what they mean by
"version checkin"? An example would be great.
I think they mean something like update verification. If you select a
row into an object and save this object the mapper should/could verify
if the row in the database hasn't change. You could use a
"last-modification"-timestamp field or a counter-field, that is set in
every successful UPDATE execution (trigger). I'm not sure if Hibernate
has "build-in-support" for this, but it's easy to implement in Torque.
Your explanation of the term makes sense. This was known to me as
"optimistic locking". I have actually implemented it for a project, and it
is relatively easy to do. The basic idea is to use triggers to
increase a counting column each time a row is saved, and to check
this column against the provided value when an update comes in. If
the provided number does not match the one in the database, the
trigger throws an error.
However, there are a few points to remember:
- The counting column needs to be updated in the save() method of the java
object accordingly to allow subsequent saves. When doing this, the
modified property of the object must not be changed, otherwise an update
occurs on every save() and not only if the object has changed.
- If one uses Sarav's patched village lib for oracle and use blobs and
clobs, the patched lib needs to be patched again.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]