openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Bauer" <techhu...@gmail.com>
Subject Re: How to annotate a positional List
Date Thu, 09 Oct 2008 17:19:34 GMT
Hi Kevin,

Thanks for posting new code.  This last set of code explains why I
didn't see the updates.  My test used the same entity manager
throughout, while the code above creates a new EM for the remove
operation.  I also saw the updates using the code above, but only if I
used runtime entity enhancement (on by default in 1.2.0).  When I used
the javaagent or build-time enhancer, I no longer saw the updates.
OpenJPA can do a better job of tracking state with build time or
javaagent enhanced entities.

In regards to the double update operation, check to see if the last
update is really an update.  By default, OpenJPA does statement
batching with Oracle so the last update entry you are be seeing may
look like a duplicate, but in fact it is simply a report that the full
batch update is being executed:

For example: (batch two statements, then execute - the execute looks
like a duplicate update)

4548  MapPU  TRACE  [main] openjpa.jdbc.SQL - <t 26506390, conn
1309601> batching prepstmnt 8546123 UPDATE ORAUSER.PAGEOFBOOK SET DATA
= ? WHERE ID = ? [params=(Reader) java.io.StringReader@1b17d49, (long)
120]
4548  MapPU  TRACE  [main] openjpa.jdbc.SQL - <t 26506390, conn
1309601> [0 ms] spent
4548  MapPU  TRACE  [main] openjpa.jdbc.SQL - <t 26506390, conn
1309601> batching prepstmnt 8546123 UPDATE ORAUSER.PAGEOFBOOK SET DATA
= ? WHERE ID = ? [params=(Reader) java.io.StringReader@1fe4169, (long)
123]
4548  MapPU  TRACE  [main] openjpa.jdbc.SQL - <t 26506390, conn
1309601> [0 ms] spent
4548  MapPU  TRACE  [main] openjpa.jdbc.SQL - <t 26506390, conn
1309601> executing batch prepstmnt 8546123 UPDATE ORAUSER.PAGEOFBOOK
SET DATA = ? WHERE ID = ? [params=(Reader)
java.io.StringReader@1fe4169, (long) 123]

In short, make sure you are using the build-time or javaagent enhancer
and if you still see updates check the last update to see if it says
"executing batch prepstmt" vs. "batching prepstmt".

-Jeremy

Mime
View raw message