ADezii 8,834
Recognized Expert Expert
Transaction Processing is a Database term that refers to the process of grouping changes to your data into a batch that is treated as a single, atomic unit. Either the entire batch of transactions succeeds, or they all fail. A typical illustration of a Transaction is the transferring of data from one account to another in a banking application. You wouldn’t want your originating account debited a specific amount, have an error occur, and not have your ending account credited.
When referring to DAO Transactions, we will be dealing with 3 critical Methods of the Workspace Object. ADO Transactions, although very similar, will be covered in another Tip. These 3 Methods are briefly mentioned below: - BeginTrans - marks the start of a series of operations that should be considered as a single, atomic unit.
- CommitTrans - takes everything since the most recent BeginTrans and writes it to disk.
- Rollback - the opposite of CommitTrans; it undoes all your changes back to the last CommitTrans. The critical word here is all.
In its basic, sketal format, DAO Transaction Processing looks something like this: - On Error GoTo Err_Handler
-
-
Dim wrkCurrent As DAO.Workspace
-
Dim blnInTrans As Boolean 'are we in a Transaction?
-
-
blnInTrans = False 'not in a Transaction yet
-
Set wrkCurrent = DAO.DBEngine.Workspaces(0)
-
'...
-
-
wrkCurrent.BegingTrans
-
blnInTrans = True 'presently in a Transaction
-
-
'make all data modifications/changes here
-
-
wrkCurrent.CommitTrans
-
blnInTrans = False 'changes committed without an Error, Transaction is complete
-
-
'...
-
Err_Handler:
-
If blnInTrans Then 'was the Transaction successfully completed, or does it need to be Rolled back?
-
wrkCurrent.Rollback
-
End If
-
'continue Error Processing if necessary
Several issues when using DAO Transaction Processing:- Not all Recordsets support Transaction Processing. Check the Transactions Property of a Recordset to see whether it supports Transaction Processing.
- Transactions affect all changes to data in the Workspace.
- You can nest Transactions in Jet Databases up to 5 levels deep. Inner Transactions must be committed or rolled back before the surrounding ones.
- If you close a Workspace without explicitly committing its transactions, all pending Transactions are automatically rolled back.
1 15063 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: JJ_377 |
last post by:
I need some suggestions on resources for learning about transaction
processing. I have an excellent SQL reference that gives the
syntax...and basic concepts but I am also interested in real world,
*interesting* applications. Ideas?
I'd be interested in up-to-date books, but other resources would be
welcome as well. I am a VB.NET/ASP.NET person...(with a VB 6/ASP
background)
Thanks for any and all!
|
by: Klemens |
last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and
an update in a local table in one transaction
Do I have to change some settings to get done or ist this not possible by
definition?
Thanks
Klemens
|
by: Zeng |
last post by:
Hi,
The bigger my C# web-application gets, the more places I need to put in the
tedious retrying block of code to make sure operations that can run into
database deadlocks are re-run (retried) 3-4 times and give up if after that
it's still in deadlock. I'm very sure that many experienced people out
there already deal with this issue somehow. Is there an alternative to it?
Thanks for your comments and suggestions.
|
by: rdemyan via AccessMonster.com |
last post by:
I have some unbound forms that I want to use transaction wrappers on when
updating the table. My question is on the scope of what transaction
processing will do. I'm going to keep it simple with the following code:
Code:
------------------------------------------------------------------------------
--
ws.BeginTrans
|
by: ikogan |
last post by:
The first release of the Transaction Processing over XML (TPoX)
database benchmark took place last week! Please take a look at
tpox.sourceforge.net.
The benchmark consists of XML schemas, XML data generation, concurrent
XML workloads (write-only, read-only and mixed), a workload driver to
take measurements and more. Currently some things work on DB2 only,
but will be extended to other systems later.
The download of the TPoX package...
| |
by: Shelly |
last post by:
I am looking for some advice on the design of a transaction processing
sequence. As I xcurrently have it, the sequence is as follows:
1 - Gather all the information from the user other than the actual charging
information.
2 - Present the user with a summary of what he is about to purchase
3 - Give him the choice of card (via PayPal) or by check.
4 - If by check, go to a screen that he has to click the "Pay" button.
5 - After the...
|
by: ikogan |
last post by:
In January, I announced our TPoX benchmark that became public on
tpox.sourceforge.net. We just had its next release.
What is new?
(1) TPoX 1.1 contains six sub-document XML level updates.
(2) The data generation now also produces XML fragments for
"accounts". These are required by Update2 which inserts new accounts
into existing custacc documents.
|
by: ADezii |
last post by:
In the Tip of the Week #19, we demonstrated Transaction Processing, specifically as it applies to DAO (Data Access Objects). In this week's Tip, we'll illustrate how Transaction Processing can be used within the context of ADO (ActiveX Data Objects). Please refer to the Link below if you wish to see an Overview of Transaction Processing, how it is implemented within DAO, or special issues to be aware of when utilizing Transaction Processing in...
|
by: Terry VanDamme |
last post by:
Hello,
I am attempting to write an application where I have code segregation where code dealing with the form is located in the form which relies on a class module (ie clsOrders) and all code that specifically deals with database connection, manipulation, etc is resident in it's own standard module.
I am using ADO and Access 2003 at the moment. I am wondering what the best method is to implement transaction processing.
I have a method...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |