Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Logging SQL results

I am seeing the following specific problem:

1) A http request comes in, issues an SQL select that returns
"ClientSession" with id 2442.
2) This returns an object with version=21. The object is updated, the
transaction is committed and the version of this object is updated to 22 in
the database.
3) A subsequent http request comes in, repeats the same process. This time
EclipseLink returns an object with version=21 (instead of 22) even though
the database really does contain 22 (I issued a query in a console window).

Here is a suspicious part of the log:

[EL Finest]: 2008.09.21
the existing object desktopbeautifier.database.domain.ClientSession[id=2442,
[EL Finest]: 2008.09.21
query ReadObjectQuery(desktopbeautifier.database.domain.ClientSession)
---- query returned:
desktopbeautifier.database.domain.ClientSession[id=2442, version=21] ----
---- An implicit flush() occurs at this point ----
[EL Finer]: 2008.09.21
[EL Finest]: 2008.09.21
[EL Warning]: 2008.09.21
Exception Stack: 
Exception [EclipseLink-5006] (Eclipse Persistence Services - 1.0 (Build 1.0
- 20080707)): org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object
[desktopbeautifier.database.domain.ClientSession[id=2442, version=22] cannot
be updated because it has changed or been deleted since it was last read. 

Sometime looks *very* wrong here...


cowwoc wrote:
> Hi,
> I'm trying to debug an SQL bug and it would be very useful to see both the
> queries by EclipseLink and the results returned by the database. So far I
> see:
> [EL Fine]: 2008.09.21
> 20:30:10.992--ServerSession(744949293)--Connection(2138276054)--Thread(Thread[httpSSLWorkerThread-8080-0,10,Grizzly])--SELECT
> ID, NAME, VERSION, parentId FROM theme WHERE (ID = ?)
>         bind => [58]
> but I don't see the results logged. I am using:
> <property name="eclipselink.logging.level" value="finest"/>
> Is there some extra logging I am supposed to enable?
> Thank you,
> Gili

View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top