Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TADConnection DiconnectAction
TADConnection DiconnectAction
Posted: 2007/08/30 11:19
 
Hi,

I have add data via my application into the orcle database from 8:00 to 13:30.
At 13:30 the network quits and the connection gets lost

Then I reconnect and from 13:30 to 16:00 I have add data.

Now the data from 8:00 - 13:30 are not in the database, it looks like they were never added, no nummers are missing in the key.

I have set the default in the TADConnection:
DiconnectAction= xdRollback
and
AutoCommit= false

Is this the problem?
I thaught only an open Transaction gehts rollback and not all data???

Is there a chance, to get the data back?
At runtime before 13:30 all data were in the database...

Thanks.
Tim.
Re:TADConnection DiconnectAction
Posted: 2007/08/30 11:34
 
Hello

Seting AutoCommit = False means, that you should explicitly control transactions. Without that, Oracle will start transaction with first modyfing data command and transaction will remain active ...

DiconnectAction= xdRollback means, that on explicit disconnecting from DB AnyDAC will issue Rollback, if there is active transaction.

Is this the problem?
Yes. Your application had from 8:00 to 13:30 single active transaction (because AutoCommit = False).

Is there a chance, to get the data back?
Most probably - no. Ask your DBA.

Regards,
Dmitry

Post edited by: Diman, at: 2007/08/30 11:36
Re:TADConnection DiconnectAction
Posted: 2007/08/30 16:40
 
But I have always used the transaction like that:

ADConnection.StartTransaction;
try
do something with a ADQuery...

ADConnection.Commit;
except
ADConnection.Rollback;
end;
Re:TADConnection DiconnectAction
Posted: 2007/08/30 23:21
 
1) Try to make some changes, run to Commit, pass it. Then check from other session, are changes in DB ? Also, you can use V$session (TADDR) view to check, if the TX is active.
2)

 except   ADConnection.Rollback; end

This code is dangerous. If inside of "try" block exception will happen, then "exception" block will rollback transaction and user will get no notification about error. You should add "raise;" after rollback.