Skip to main content


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] Mon, 28 January 2013 01:57 Go to next message
Mixa Alekseev is currently offline Mixa AlekseevFriend
Messages: 10
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 05:21 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
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: Sat Apr 20 01:36:15 GMT 2024

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

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

Back to the top