Workspace Transaction Begin/Commit/Rollback bug? 
Author Message
 Workspace Transaction Begin/Commit/Rollback bug?

I am working on an app using VB 4.0 Pro with data-bound controls. Right
now I'm going against an Access database, but plan to use ODBC to
migrate the database into Sybase.

I'm trying to use the Workspace.BeginTrans, Workspace.CommitTrans and
Workspace.Rollback to manage database transactions. The documentation
claims you can nest transactions up to 5 levels deep within a workspace.
When my app has transcations nested two deep, though, the first
commit/rollback works just fine, but the second one consistently
generates run-time error 3034: "Commit or Rollback without BeginTrans".

It's as if the outer transaction was (in)conveniently forgotten. Has
anyone else experienced this problem? Is there a fix or workaround?

Martin Danner



Fri, 07 May 1999 03:00:00 GMT  
 Workspace Transaction Begin/Commit/Rollback bug?

Quote:

>I'm trying to use the Workspace.BeginTrans, Workspace.CommitTrans and
>Workspace.Rollback to manage database transactions. The documentation
>claims you can nest transactions up to 5 levels deep within a workspace.
>When my app has transcations nested two deep, though, the first
>commit/rollback works just fine, but the second one consistently
>generates run-time error 3034: "Commit or Rollback without BeginTrans".

Please try to limit yourself to one transaction only. They are very
tricky. I successfully nested 3 transaction blocks once, but no more.
Unfortunately success of transactions also depends on the code
executed withing transaction. According to MSDN (and my own bitter
experience) use of mdb.OpenRecordset("anything here", anything here)
within transaction block is _dicouraged_, because it wreaks havoc with
transactions. Try, 50/50 that you will get weird errors, such as you
described. Recommended use of transactions (again according to msdn
and me) would be big delete queries (in case of error you rollback
everything) - but don't leave user with message box prompting if he
wants to commit transaction - BAD IDEA in multiuser enviroment;
and also any adding or editing of a record(s) - to lessen hard
drive/network access time.

Again, I want to say- nesting WONT work in most of the cases, at least
not with MSAccess.

Regards
Daniel

Seattle, WA



Sat, 08 May 1999 03:00:00 GMT  
 Workspace Transaction Begin/Commit/Rollback bug?

I get the same problem!  But I am not nesting.  I am trying to use the
Transsaction methods with True DBGrid and it is rqther frustrating.  

Any help would be appreciated.



Tue, 18 May 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Begin-Rollback-Commit Transaction

2. workspace commit/rollback

3. VB6 - DAO Begin/Commit & Rollback

4. Limits on Transactions between Begin & Commit

5. ADO Begin/Commit Transactions

6. ADO and Transaction in SQL Server 7.0: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

7. Commit/Rollback spanning procedures

8. DB Commit\Rollback Issues

9. How does .commit and .rollback work?

10. VB4 - Commit or Rollback without BeginTrans. (Error 3034)

11. Commit and Rollback

12. Using commit/rollback with Oracle and RDO

 

 
Powered by phpBB® Forum Software