Click here to Skip to main content
16,005,206 members
Home / Discussions / Database
   

Database

 
GeneralRe: restore database a from f:\x.mdb do you have any adiea Pin
Vasudevan Deepak Kumar15-Aug-05 0:57
Vasudevan Deepak Kumar15-Aug-05 0:57 
GeneralADO and ODBC Pin
xxxooxxx11-Aug-05 23:03
sussxxxooxxx11-Aug-05 23:03 
GeneralRe: ADO and ODBC Pin
Colin Angus Mackay12-Aug-05 0:17
Colin Angus Mackay12-Aug-05 0:17 
Questionplease help me ? Pin
Anonymous11-Aug-05 22:26
Anonymous11-Aug-05 22:26 
QuestionRollback not working. Any ideas? Pin
Marc Clifton11-Aug-05 12:35
mvaMarc Clifton11-Aug-05 12:35 
GeneralRe: Rollback not working. Any ideas? Pin
mortrr11-Aug-05 12:47
mortrr11-Aug-05 12:47 
GeneralRe: Rollback not working. Any ideas? Pin
Marc Clifton11-Aug-05 13:12
mvaMarc Clifton11-Aug-05 13:12 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Rob Graham11-Aug-05 12:56
Rob Graham11-Aug-05 12:56 
I believe that what is meant is that you should not:

1. issue "set implicit_transactions on" at any point in your code (sql statements) as this turns on autocommit and defeats the possibility of rollback

2. Use transactions inside stored procedures or SQL statements, since commits inside the sproc/SQL will break rollback of the containing (external .NET) transactions.

Basically you have three choices:
1. do all transactions with the API.
2. Use autocommit and forget transactions (bad idea most of the time).
3. do transactions in stored procedures/SQL and not the API.

any mixing of these will be broken in strange ways.

this quote from books online is also pertinent:

If a severe error prevents the successful completion of a transaction, SQL Server automatically rolls back the transaction and frees all resources held by the transaction. If the client's network connection to SQL Server is broken, any outstanding transactions for the connection are rolled back when the network notifies SQL Server of the break. If the client application fails or if the client computer goes down or is restarted, this also breaks the connection, and SQL Server rolls back any outstanding connections when the network notifies it of the break. If the client logs off the application, any outstanding transactions are rolled back.

If a run-time statement error (such as a constraint violation) occurs in a batch, the default behavior in SQL Server is to roll back only the statement that generated the error. You can change this behavior using the SET XACT_ABORT statement. After SET XACT_ABORT ON is executed, any run-time statement error causes an automatic rollback of the current transaction. Compile errors, such as syntax errors, are not affected by SET XACT_ABORT.




[Edit] modified to clarify that Transactions inside SQL statements should not be mixed either
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke

GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton11-Aug-05 13:14
mvaMarc Clifton11-Aug-05 13:14 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Rob Graham11-Aug-05 13:20
Rob Graham11-Aug-05 13:20 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton11-Aug-05 13:23
mvaMarc Clifton11-Aug-05 13:23 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Rob Graham11-Aug-05 13:27
Rob Graham11-Aug-05 13:27 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton11-Aug-05 13:32
mvaMarc Clifton11-Aug-05 13:32 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Rob Graham11-Aug-05 13:44
Rob Graham11-Aug-05 13:44 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton11-Aug-05 13:59
mvaMarc Clifton11-Aug-05 13:59 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 6:36
ToddHileHoffer12-Aug-05 6:36 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton12-Aug-05 6:45
mvaMarc Clifton12-Aug-05 6:45 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
ToddHileHoffer12-Aug-05 7:04
ToddHileHoffer12-Aug-05 7:04 
GeneralRe: Rollback not working. Any ideas? [Edit] Pin
Marc Clifton13-Aug-05 12:30
mvaMarc Clifton13-Aug-05 12:30 
GeneralCorrelated Subquery Problem Pin
mjackson1111-Aug-05 9:52
mjackson1111-Aug-05 9:52 
GeneralRe: Correlated Subquery Problem Pin
ToddHileHoffer12-Aug-05 7:09
ToddHileHoffer12-Aug-05 7:09 
GeneralAt attempt 341: "Object not set to an instance of an object" Pin
alexvw11-Aug-05 5:10
alexvw11-Aug-05 5:10 
GeneralT-SQL Question Pin
WDI11-Aug-05 1:43
WDI11-Aug-05 1:43 
GeneralRe: T-SQL Question Pin
Colin Angus Mackay11-Aug-05 2:23
Colin Angus Mackay11-Aug-05 2:23 
GeneralRe: T-SQL Question Pin
Michael Potter11-Aug-05 4:02
Michael Potter11-Aug-05 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.