The fact is that the persistenceState of dataobjects is being set to COMMITTED
before the actual transaction (db transaction or whatever) is committed,
specially when running commitChanges() inside performInTransaction() for the
purpose to run additional code inside the same transaction and aft
I think changing Cayenne is the wrong solution here.
The problem is that your commit failed. You have to rollback the context if
you want to keep using it.
On Mon, Apr 11, 2016 at 2:22 PM Juan Manuel Diaz Lara
wrote:
> Calling rollbackChanges will lost all changes, and create a new context
> an
Calling rollbackChanges will lost all changes, and create a new context and
start over is complex with many and variables changes to replicate in the new
context...
I think the problem is that sync with db state is lost if the dataobjects are
market commited before the real transaction commits,
Try calling context.rollbackChanges() or just create a new context and
start over.
On Mon, Apr 11, 2016 at 10:31 AM Juan Manuel Diaz Lara
wrote:
>
>
> I am using 4.0.M3.
> I used the following solution, but the problem is that after
> commitChanges() the dataobjetcs are set to PersistenceState.C
I am using 4.0.M3.
I used the following solution, but the problem is that after commitChanges()
the dataobjetcs are set to PersistenceState.COMMITED, if the stored procedure
fails Cayenne does a DB rollback (that's ok), but dataobjects stay COMMITED, so
I can not retry the this transaction aft
See the bottom part of this page starting at "In the second scenario":
https://cayenne.apache.org/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html#transactions
On Mon, Apr 11, 2016 at 10:54 AM, Juan Manuel Diaz Lara
wrote:
>
>
> I have a dataobjet graph with some changes, and a db
I have a dataobjet graph with some changes, and a db stored procedure that
should run after this changes are in the db, but must run in the same
transaction because it make some more changes to other data, this changes can
fail so I want the commitChanges fail if the stored procedure fails.
> 1. JetConf in Minsk, Belarus March 25: http://jetconf.by/#/andrus_adamchik
That's April 25th. March is over already of course :)
> On Apr 11, 2016, at 1:51 PM, Andrus Adamchik wrote:
>
> FYI: I will be doing 2 Cayenne presentations in Eastern Europe this spring:
>
> 1. JetConf in Minsk, Bel
FYI: I will be doing 2 Cayenne presentations in Eastern Europe this spring:
1. JetConf in Minsk, Belarus March 25: http://jetconf.by/#/andrus_adamchik
2. JeeConf in Kiev, Ukraine May 20-21: http://jeeconf.com/program/
Target audience for the talk not the current Cayenne users, but rather folks
u