Re: Problem with commit while deleting rows from table
Re: Problem with commit while deleting rows from table
- Subject: Re: Problem with commit while deleting rows from table
- From: LD <email@hidden>
- Date: Thu, 15 Jul 2004 00:50:43 +1000
Hi there,
On 14/07/2004, at 8:19 PM, Tanmoy Roy wrote:
Hi all,
I have a requirement where for any user updation I need to first
delete some specific rows and then insert the fresh rows in the
database. EOModeler does a AutoCommit whenever we are deleting or
updating something in the database.
EOModeler or EOEditingContext?
But the scenario is if we have deleted some rows and during insertion
some exception occurs then all our data will be lost. Is there a work
around here ? Please note that the deletion step is essential here as
well as the fresh insertion.
Doesn't EOF always attempt to turn off autocommit? The 5.2 release
notes mention something about this. Have you overridden this?
java.lang.Object
|
+--com.webobjects.eoaccess.EOAdaptorContext
|
+--com.webobjects.jdbcadaptor.JDBCContext
Atomicity (the first test of ACID compliance) says "all or nothing".
So, auto-committing in-between the two operations would not be helping
you. EOEditingContext will do the work for you in normal
circumstances... saveChanges() or revert() as needed.
myJDBCContext.connection().getAutoCommit() should be false prior to
transaction, at least.
myJDBCContext.connection().setAutoCommit(false) if not...
HTH
with regards,
--
Lachlan Deck
(@yahoo.com.au)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.