Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Transaction Rollback not working - Why?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Sep 3, 2015 9:39 AM Last Post By: Dmitry Arefiev
Norbert Meier

Posts: 19
Registered: 11/26/01
Transaction Rollback not working - Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2015 1:57 AM
Hi,

I've a problem with a transaction. In a test project the same code is working as expected, so there should be some settings that I missed in my real world project.
It seems that a Post on TFDTable will autoCommit in the real project, but not in the test project.

Can anybody give me a hint which setting(s) I should check to avoid the AutoCommit?

Regards
Norbert
Eric Buescher

Posts: 15
Registered: 4/30/09
Re: Transaction Rollback not working - Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2015 11:49 AM   in response to: Norbert Meier in response to: Norbert Meier
Norbert Meier wrote:
Hi,

I've a problem with a transaction. In a test project the same code is working as expected, so there should be some settings that I missed in my real world project.
It seems that a Post on TFDTable will autoCommit in the real project, but not in the test project.

Can anybody give me a hint which setting(s) I should check to avoid the AutoCommit?

Regards
Norbert

I'm having the same issue. Did you ever get this resolved? My FDQuerys are working, but not the FDTables and I can't figure out why. My queries are using the same FDConnection as the FDTable. I'm using Delphi XE6.
-Eric
Eric Buescher

Posts: 15
Registered: 4/30/09
Re: Transaction Rollback not working - Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 3, 2015 8:17 AM   in response to: Eric Buescher in response to: Eric Buescher
Eric Buescher wrote:
Norbert Meier wrote:
Hi,

I've a problem with a transaction. In a test project the same code is working as expected, so there should be some settings that I missed in my real world project.
It seems that a Post on TFDTable will autoCommit in the real project, but not in the test project.

Can anybody give me a hint which setting(s) I should check to avoid the AutoCommit?

Regards
Norbert

I'm having the same issue. Did you ever get this resolved? My FDQuerys are working, but not the FDTables and I can't figure out why. My queries are using the same FDConnection as the FDTable. I'm using Delphi XE6.
-Eric

I fixed the problem. I am using Cached Updates and the Rollback wasn't releasing them, so if the ChangeCount>0 I now do a CancelUpdates after the Rollback. I don't know if this is how you're supposed to do this, as I can't find any documentation on this, but at least it's working. I guess the other option is not to use Cached Updates if you're using Transactions to process the updates.
Here's a link about FireDAC cached updates: http://docwiki.embarcadero.com/RADStudio/XE8/en/Caching_Updates_(FireDAC)
-Eric
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Transaction Rollback not working - Why?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 3, 2015 9:39 AM   in response to: Eric Buescher in response to: Eric Buescher
Cached Updates and Transactions are two different things. Cached Updates
allows to cache changes on the client and post all of them to DB in a single call.
Transaction allows to perform several manipulations with DB as a single unit.
Transaction rollback does not undo changes cached on the client. As updates
applying may be performed as a single transaction or each update as separated
unit.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02