|
Re: [enhydra] Re: [dods] Version conflict problem: msg#00015java.enhydra.general
Hi, If parameter references is true, it means that referenced DO's are being saved in the same transaction if they are changed in memory. If not, or if not created in memory, they will not be loaded. Did you try to update the same DO after exception (and transaction release)? You should do it in next transaction. Also I suggest you using of explicit transactions in your code (create DOs in transaction, made modifications, save DOs in transaction, call write and finally commit) Regards, Sinisa ----- Original Message ----- From: "Ricardo Tedim" <rjtedim@xxxxxxxxxxxx> To: <enhydra@xxxxxxxxxxxxx> Sent: Thursday, July 14, 2005 6:14 AM Subject: [enhydra] Re: [dods] Version conflict problem > Hi, > > I've noticed that in DODS 5.1 and 6.x (in opposition to previous > versions) every DO generated has a new method associated to it where the > "references" parameter is always being set to true by methods > save(DBTransaction dbt) and save(): > > public void save(DBTransaction dbt, boolean references) > > For what I understood after sniffing the DODS generated code, when this > parameter is set to true all the referenced DO's are being loaded (?) > and updated in DB. Is this the real goal for this parameter? Why is it > always set to true? Could this be related with the error I've described > in the email bellow? > > Thanks in advance, > Ricardo > > > Ricardo Tedim wrote: > > > Hi, > > > > I'm using DODS 5.1 and I'm facing a problem with conflicting SQL > > update statements (from different JVMs) to the same DB entry. I have > > an object Entry that has a integrity reference to object User (both of > > them aggregate their own DOs). If I try to update the same user from > > different JVMs I get in one of them a version confict (as expected): > > > > [...] > > Caused by: java.sql.SQLException: Update failed, but Table userinfo > > id=1000023 does exist with version=5353 > > at > > com.lutris.appserver.server.sql.CoreDO.seeWhatHappened(Unknown Source) > > at com.lutris.appserver.server.sql.CoreDO.executeUpdate(Unknown > > Source) > > at > > com.lutris.dods.builder.generator.dataobject.GenericDO.executeUpdate(Unknown > > Source) > > at com.lutris.appserver.server.sql.CoreDO.executeInsert(Unknown > > Source) > > at > > com.lutris.dods.builder.generator.dataobject.GenericDO.executeInsert(Unknown > > Source) > > at > > com.mobicomp.mobilekeeper.data.db.user.UserDO.executeInsert(UserDO.java:2585 ) > > > > at > > com.lutris.appserver.server.sql.standard.StandardDBTransaction.write(Unknown > > Source) > > at > > com.lutris.appserver.server.sql.standard.StandardDBTransaction.commit(Unknow n > > Source) > > at com.mobicomp.Entry.save(Entry.java:131) > > ... 20 more > > > > However in the JVM where the version conflict occured, if I try to > > perform any update to the User instance loaded in memory (loaded > > before the version conflict occured), I always get the following > > exception (in this example I try to save Entry which has a integrity > > reference to User): > > > > [...] > > Caused by: java.lang.NullPointerException > > at com.mobicomp.UserDO.getUpdateStatement(UserDO.java:6023) > > at com.lutris.appserver.server.sql.CoreDO.executeUpdate(Unknown > > Source) > > at > > com.lutris.dods.builder.generator.dataobject.GenericDO.executeUpdate(Unknown > > Source) > > at com.lutris.appserver.server.sql.CoreDO.executeInsert(Unknown > > Source) > > at > > com.lutris.dods.builder.generator.dataobject.GenericDO.executeInsert(Unknown > > Source) > > at > > com.mobicomp.mobilekeeper.data.db.user.UserDO.executeInsert(UserDO.java:2585 ) > > > > at > > com.lutris.appserver.server.sql.standard.StandardDBTransaction.write(Unknown > > Source) > > at > > com.lutris.appserver.server.sql.standard.StandardDBTransaction.commit(Unknow n > > Source) > > at com.mobicomp.Entry.save(Entry.java:131) > > ... 20 more > > > > I was expecting an error in this situation but not a > > NullPointerException. It seems like the object has become corrupted > > with the version conflict. Is this some known issue from DODS 5.1? > > > > Thanks in advance, > > Ricardo > > > > > > > > ---------------------------------------------------------------------------- ---- > > -- > You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing list. > To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx > For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > -- You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing list. To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [enhydra] DeleteCascade on PostgreSQL, Ricardo Tedim |
|---|---|
| Next by Date: | [enhydra] Requests with more than 8K, Rafael Torres |
| Previous by Thread: | [enhydra] Re: [dods] Version conflict problem, Ricardo Tedim |
| Next by Thread: | [enhydra] Requests with more than 8K, Rafael Torres |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |