[cdo] how several CDO transactions can commit their changes using one durable view? [message #1248943] |
Mon, 17 February 2014 15:33  |
Eclipse User |
|
|
|
Hi all,
Our project works with CDO. There is a common strategy: every editor corresponds a single transaction.
Now I faced with a problem of using durable views.
Users want take several write locks on different CDO resources within one durable view and open several editors to modify these resources, but there is no way to open several instances of a durable view with the same LockingID.
Is there any idea how several CDO transactions can commit their changes using one durable view?
Thanks,
Evgeniy
|
|
|
Re: [cdo] how several CDO transactions can commit their changes using one durable view? [message #1249385 is a reply to message #1248943] |
Tue, 18 February 2014 02:37   |
Eclipse User |
|
|
|
Am 17.02.2014 22:02, schrieb Evgeniy Vishnyakov:
> Hi all,
>
> Our project works with CDO. There is a common strategy: every editor corresponds a single transaction.
>
> Now I faced with a problem of using durable views.
> Users want take several write locks on different CDO resources within one durable view and open several editors to
> modify these resources, but there is no way to open several instances of a durable view with the same LockingID.
>
> Is there any idea how several CDO transactions can commit their changes using one durable view?
A CDOLock always has a single CDOLockOwner, which, on the client side is the CDOTransaction or CDOView. In other words,
CDOObjects are always locked into their current view. The only way to change that is to either unlock the object, either
explicitely or by committing the transaction with autoReleaseLocks=true. An exception to this rule is a durable view,
which can be closed and then the locks be "taken over" by another view (that knows the secret durable locking ID).
A CDOTransaction is a means to isolate changes from other views. As such I see no way to let several transactions share
their locks. You'll probably have to look for a way to let your editors share a single CDOTransaction, similar to the
CDO Sessions view part that maintains shared transactions for multiple editor instances each.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [cdo] how several CDO transactions can commit their changes using one durable view? [message #1249507 is a reply to message #1249495] |
Tue, 18 February 2014 05:14  |
Eclipse User |
|
|
|
Am 18.02.2014 10:59, schrieb Evgeniy Vishnyakov:
> In case we will use one CDO transaction for several editors after saving one of them other ones will be saved too. But
> it's actually not what we need.
Yes, with CDO you always commit the underlying transaction when you save a single resource. And note that a normal model
editor lets you edit an entire resource set, so that saving the editor may save a bunch of resources (which will lead to
a single commit in CDO).
You might want to play with CDOTransaction.setCommittables(), which you can use for partial commits. You'd have to think
about the case of multiple editors modifying the (logically and physically) same object. Also note that
setCommittables() doesn't let you commit inconsistent subsets of the dirty/new objects.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.13044 seconds