"Michael Gentry (Yes, I'm a Contractor)" <michael_gentr..anniemae.com>
wrote:
>
> Iım getting an optimistic locking failure when trying to update a record.
> Here is a portion of the log with the problem highlighted (and reformatted
> to be easier to read, hopefully):
>
> 14:26:55,115 INFO QueryLogger:315 -
> UPDATE LoanCommitment
> SET identifier = ?,
> commitmentOpenState = ?
> WHERE identifier = ? AND
> comments IS NULL AND
> commitmentOpenState = ? AND
> commitmentPeriod = ?
> AND createDate = ? ...
>
> 14:26:55,196 INFO QueryLogger:337 -
> [bind: < 00 00 00 00 00 00 00 22 59 2D F7 52 >,
> [CREATED [DB=1]],
> < 00 00 00 00 00 00 00 22 59 2D F7 52 >,
> NULL,
> [SUBMITTED [DB=2]],
> 30, ...
>
>
> It seems to me that if it is going to produce ³comments IS NULL² as part
of
> the prepared statement, it shouldnıt try to do a bind parameter, too. It
is
> trying to bind the NULL to the commitmentOpenState, when the original
value
> was a 2, so it is failing with a locking exception.
If that's really the case, it's pretty strange.
org.objectstyle.cayenne.access.trans.UpdateBatchQueryBuilder is where you
want to look.
createSqlString() is what generates the query text (once).
bindParameters() is what binds the parameters (once for each batch data
set).
Maybe this is a problem specific to your particular DBAdaptor if it has
custom handling for this.
I see there's also a LOBUpdateBatchQueryBuilder, so maybe it's not behaving
properly if you're triggering that instead.
It'd probably be a good idea to state what version of Cayenne, and which
DBAdaptor you're using.
-Mike
This archive was generated by hypermail 2.0.0 : Tue May 10 2005 - 15:43:24 EDT