473,765 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transaction Processing in a Modular Environment

2 New Member
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 for executing the sql, one for opening the database, one for closing it, one for supplying the required SQL, etc in the database module.

There is a function in the clsOrders module - say InsertOrder that calls the function in the db module to get the sql string and then calls a function in the db module (ProcessOrderIn sertion) that in turn calls the OpenDBConnectio n function and then the ExecuteQuery Function using the current sqlString, then calls CloseDBConnecti on and then exits back to the InsertOrder function in the class module which then gets the string for the next transaction and then calls ProcessOrderIns ertion in the db module again, etc until all queries in the current group are processed.


So using the above setup I am wondering if it is possible to use the following code (simplified) in the Calling Function in the Class module?

Expand|Select|Wrap|Line Numbers
  1.  
  2. On Error GoTo Err_Handler
  3.  
  4.   cn.BeginTrans
  5.  
  6.   Call Functions in other module until
  7.   all sql statements are done
  8.  
  9.   cn.CommitTrans
  10.  
  11. Err_Handler:
  12.   cn.RollbackTrans
  13.  
  14.  

An issue that I see or am not sure of how to readily deal with or have questions about is:

Where the functions processing the data are in another module and bearing that in mind, will the error handling code properly detect an error that would happen in the ExecuteQuery Function that is two function levels below the calling one and in a different module?

Also, the code creating the ADO connection (cn) is also located in the database module which would suggest that the transaction handling code should also be in the same module.

The ProcessOrderIns ertion only processes one query at a time prior to passing control back. This is like this as it is a generic function used by all other sections of the application and there is some times only one statement run but other times there would be multiple statements.

It's easy enough to call the DBConnect and Disconnect functions seperately but I guess again the main question is how to implement the error detection mechanism to decide whether to commit or rollback.

Any insight would be much appreciated.

Thank you,
Terry Van de Velde

PS. My last name is not VanDamme, however the name field on the registration form did not have enough room for my real name.
Feb 27 '11 #1
1 1987
Terry VanDamme
2 New Member
Thanks for any who would reply.

I have located this post which I think answers my question:

http://bytes.com/topic/access/answer...ction-question

If there is anything that you feel would help me further, I'd be happy to hear from you.

Regards,
Terry Van de Velde
Feb 28 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1247
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!
5
3343
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
15
10001
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.
3
2717
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
3
3163
by: GoogleEyeJoe | last post by:
Dear ladies and gents, I'm trying to determine whether the .NET Framework implements a means of transactional processing without the need for a database. Essentially, I'd like to enlist light-weight portable business objects within transactions so that that have the ability to roll-back if the client of the object wishes to undo any changes made. For example, if I had a, let's say for sake of simplicity, a person class that had two...
0
1727
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...
4
2058
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...
0
1360
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.
1
15067
ADezii
by: ADezii | last post by:
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...
0
17537
ADezii
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...
0
9566
marktang
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...
0
10153
Oralloy
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...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2800
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.