Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] 4.1 transaction rollback after a commit(Understanding)
[CDO] 4.1 transaction rollback after a commit [message #1005642] Sun, 27 January 2013 20:57 Go to next message
Mixa Alekseev is currently offline Mixa Alekseev
Messages: 9
Registered: February 2011
Junior Member
CDO Version emf-cdo-M20130118-0411-Site (and previous)

...
System.out.println(project.getId()); << out: "name"

transaction.setSavepoint();

project.setId("newname");

transaction.commit();

System.out.println(project.getId()); // out: "newname"

transaction.rollback();

System.out.println(project.getId()); // out: "newname" (I expected "name")

project = transaction.getObject(project.cdoID());

System.out.println(project.getId()); // out: "newname"


What am I doing wrong?


Sorry for my bad English.
Re: [CDO] 4.1 transaction rollback after a commit [message #1005658 is a reply to message #1005642] Mon, 28 January 2013 00:21 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5446
Registered: July 2009
Senior Member
Am 28.01.2013 02:57, schrieb Mixa Alekseev:
> CDO Version emf-cdo-M20130118-0411-Site (and previous)
>
>
> ..
> System.out.println(project.getId()); << out: "name"
>
> transaction.setSavepoint();
>
> project.setId("newname");
>
> transaction.commit();
This commits all changes of the entire transaction (all savepoints).

>
> System.out.println(project.getId()); // out: "newname"
>
> transaction.rollback();
At this point the transaction is not dirty because the commit() has saved everything. CDO does not support nested
transactions.

Cheers
/Eike

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


>
> System.out.println(project.getId()); // out: "newname" (I expected "name")
>
> project = transaction.getObject(project.cdoID());
>
> System.out.println(project.getId()); // out: "newname"
>
>
> What am I doing wrong?
>
Previous Topic:Don't Get It - anyURI and ecore:reference
Next Topic:Mapping eType of reference to eType of attribute
Goto Forum:
  


Current Time: Sun Apr 20 02:57:41 EDT 2014

Powered by FUDForum. Page generated in 0.02771 seconds