Re: Transaction Support in Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Rahul,

You might be better to use automatic transaction processing.
Imports System.EnterpriseServices

<Transaction(TransactionOption.RequiresNew)> _
Public Class myClass
<AutoComplete(True)> _
Public Sub myProcedure()
..........

Using declarative transaction processing relieves you of the burden of
managing them in code. I'm certainly no DotNet expert, so I recommend you
ask this question in the appropriate VB DotNet newsgroups.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

"Rahul" <Rahul@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:485795DC-739B-41E4-BE15-48C477AC01AB@xxxxxxxxxxxxxxxx
I am using VB.NET 2005 to program a Database Application, with Access 2003
as
the DB backend.
Every now & then, I have to make a series of updates to the tables as a
result of user actions. Either all of these updates should be performed or
none of them should be applied to the database.

ADO.NET provides transactions fo the purpose. So, I create OleDB commands
for each update.
Now, the problem is that when I set the command's Transaction property as:

command.Transaction=tx

and later try to commit or rollback the transaction using,

tx.Commit or
tx.Rollback

It gives me an exception saying that the transaction has already closed.
If I dont commit but simply set the command's transaction property, then
none of the update is applied to the database, even when no exception is
generated.

What is the solution to my problem????


.



Relevant Pages

  • RE: Master/Detail Transactions
    ... If any of the updates fails, ... pending parent and child rows within the scope of a transaction, ... cascade newly retrieved parent identity values down to pending child rows ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Recordset.AddNew and the recordset objects data retaining
    ... I absolutely think that in extremely large jobs, ... I know, I could send a single transaction containing 10,000 records but it ... > physical memory to accommodate the TWO sets of 100,000 records: ... >> The statement you make about the individual updates not hitting the ...
    (microsoft.public.data.ado)
  • Re: Recordset.AddNew and the recordset objects data retaining
    ... The statement you make about the individual updates not hitting the database ... to do with the updates being in a transaction but rather on whether you specify ... spill over and the memory starts paging out to disk that concerns me). ...
    (microsoft.public.data.ado)
  • Re: Using transactions to insert into to a table while allowing read access to existing data
    ... purpose but to roll back the transaction. ... rows with uncommitted updates are marked with locks. ... isolation level is READ COMMITTED, ... then finally committing the transaction. ...
    (microsoft.public.sqlserver.programming)
  • Master/Detail Transactions
    ... If any of the updates fails, ... attempt to run the transaction as an ADO.net SqlTransaction, ... just don't know how to deal with the Master/Detail relationship. ... accomplish this with an Identity Field? ...
    (microsoft.public.dotnet.framework.adonet)