Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO/db4o store] Multi session/transaction problems
[CDO/db4o store] Multi session/transaction problems [message #990060] Mon, 10 December 2012 16:48 Go to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
I'm trying to switch from Hibernate Store to db4o store.

I have 2 client applications that have their own Session/Transaction.
Transaction is never closed until the client isn't.

Assume Client1 = C1 & Client2 = C2.

C1 makes changes to its transaction
C1 commits
OK
C2 makes changes to its transaction
C2 commits
NOK !

It get this server side :
java.util.ConcurrentModificationException: Attempt by Transaction[4:1] to modify historical revision: OID2:0v13
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.isContainerLocked(TransactionCommitContext.java:802)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.lockObjects(TransactionCommitContext.java:735)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:434)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)


Using debug in TransactionCommitContext.isContainerLocked(), I found that resource revision version is not incremented on C2 when C1 commits its changes.

Must I use PassiveUpdate mode ? I hope no cause it does not work in my app ...

Thanks !

UPDATE :
Same problem with DBStore
java.lang.IllegalStateException: Can only retrieve current version 14 for OID2 - version requested was CDORevisionDelta[CDOResource@OID2:0v13 --> [CDOFeatureDelta[contents, LIST, list=[CDOFeatureDelta[contents, ADD, value=oid1, index=105]]]]]
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.readRevisionByVersion(DBStoreAccessor.java:283)
	at org.eclipse.emf.cdo.internal.server.Repository.loadRevisionByVersion(Repository.java:519)
	at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisionByVersion(CDORevisionManagerImpl.java:236)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.isContainerLocked(TransactionCommitContext.java:798)

[Updated on: Mon, 10 December 2012 17:25]

Report message to a moderator

Re: [CDO/db4o store] Multi session/transaction problems [message #990142 is a reply to message #990060] Tue, 11 December 2012 06:42 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Ben,

Please wait with that switch until we hear from Vik (the developer of the DB4O store) whether he plans to maintain it
properly. I won't! Of course you could decide to maintain it yourself or become a CDO committer ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 10.12.2012 17:48, schrieb ben ben:
> I'm trying to switch from Hibernate Store to db4o store.
>
> I have 2 client applications that have their own Session/Transaction.
> Transaction is never closed until the client isn't.
>
> Assume Client1 = C1 & Client2 = C2.
>
> C1 makes changes to its transaction
> C1 commits
> OK
> C2 makes changes to its transaction
> C2 commits
> NOK !
>
> It get this server side :
>
> java.util.ConcurrentModificationException: Attempt by Transaction[4:1] to modify historical revision: OID2:0v13
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.isContainerLocked(TransactionCommitContext.java:802)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.lockObjects(TransactionCommitContext.java:735)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:434)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>
>
> Using debug in TransactionCommitContext.isContainerLocked(), I found that resource revision version is not incremented
> on C2 when C1 commit it's changes.
>
> Must I use PassiveUpdate mode ? I hope no cause it does not work in my app ...
>
> Thanks !


Re: [CDO/db4o store] Multi session/transaction problems [message #990150 is a reply to message #990142] Tue, 11 December 2012 07:28 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
Thanks for your reply Eike.

It would be a pleasure if I found enough time Wink

What about the same problem with DBStore (HSQLDB) ? I guess this store is properly maintained, no ?
Re: [CDO/db4o store] Multi session/transaction problems [message #990152 is a reply to message #990150] Tue, 11 December 2012 07:37 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 11.12.2012 08:28, schrieb ben ben:
> Thanks for your reply Eike.
>
> It would be a pleasure if I found enough time ;)
Let me know if you need help to run the tests for DB4O.

> What about the same problem with DBStore (HSQLDB) ? I guess this store is properly maintained, no ?
The DBStore is one of the best maintained stores. It's probably the one most used.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO/db4o store] Multi session/transaction problems [message #990154 is a reply to message #990152] Tue, 11 December 2012 07:53 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
I get the same problem with DBStore. I tried :
- Derby
- H2
- HSQLDB
- MySQL

I'm probably missing something ...

[Updated on: Tue, 11 December 2012 07:57]

Report message to a moderator

Re: [CDO/db4o store] Multi session/transaction problems [message #990157 is a reply to message #990154] Tue, 11 December 2012 08:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 11.12.2012 08:53, schrieb ben ben:
> I get the same problem with DBStore. I tried :
> - Derby
> - H2
> - HSQLDB
Okay, I'll try to reproduce it in a test. Please cc yourself to https://bugs.eclipse.org/bugs/show_bug.cgi?id=396181

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO/db4o store] Multi session/transaction problems [message #990159 is a reply to message #990157] Tue, 11 December 2012 08:21 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
Done !

Eike Stepper wrote on Tue, 11 December 2012 03:12
Am 11.12.2012 08:53, schrieb ben ben:
> I get the same problem with DBStore. I tried :
> - Derby
> - H2
> - HSQLDB
Okay, I'll try to reproduce it in a test. Please cc yourself to https://bugs.eclipse.org/bugs/show_bug.cgi?id=396181

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper

Re: [CDO/db4o store] Multi session/transaction problems [message #990174 is a reply to message #990159] Tue, 11 December 2012 09:44 Go to previous messageGo to next message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
I'm beginning to understand ....

First of all, I made a mistake, the problem also occurs with Hibernate Store (sorry for db4o & DBStore).

To summarize, CDOObjects commited by C1 & C2 are directly contained into CDOResource.

On commit, CDOResource is tagged as "modified object", so it's commited and its revision is incremented.

I'm going to change my model to avoid this problem, but can you confirm that having to commit CDOResource when a new contained object is added into is a normal behavior ?

Re: [CDO/db4o store] Multi session/transaction problems [message #990175 is a reply to message #990174] Tue, 11 December 2012 09:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 11.12.2012 10:44, schrieb ben ben:
> I'm beginning to understand ....
>
> First of all, I made a mistake, the problem also occurs with Hibernate Store (sorry for db4o & DBStore).
>
> To summarize, CDOObjects commited by C1 & C2 are directly contained into CDOResource.
>
> On commit, CDOResource is tagged as "modified object", so it's commited and its revision is incremented.
Correct.

> I'm going to change my model to avoid this problem, but can you confirm that having to commit CDOResource when a new
> contained object is added into is a normal behavior ?
Yes. Every possible commit change set contains at least 1 changed object, even if you only made additions or deletions
(they will always change the container object).

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO/db4o store] Multi session/transaction problems [message #990177 is a reply to message #990175] Tue, 11 December 2012 10:01 Go to previous message
ben ben is currently offline ben benFriend
Messages: 28
Registered: June 2012
Junior Member
OK. Thanks for all your help.
Previous Topic:[CDO/Hibernate] detaching objects with references
Next Topic:Implement a third-party interface in EMF
Goto Forum:
  


Current Time: Thu Mar 28 10:19:02 GMT 2024

Powered by FUDForum. Page generated in 0.03878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top