473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Transaction across forms

Lyn
Hi,
I have two tables in a many-to-many relationship, linked by a third table.

TableA
RecNumA (Autonum)
[other fields...]

TableB
RecNumB (Autonum)
[other fields]

TableC (linking table
RecNumA (reference to primary key of TableA)
RecNumB (reference to primary key of TableB)

FormA is used to maintain records in TableA.
FormB is used to maintain records in TableB.

Whenever FormA is used to create or update a TableA record, FormB may
optionally be opened to make an associated change to TableB. TableC will
also be updated as necessary to link the TableA and TableB records.

Here (finally!) is my question. I would like to update all three tables
(when changed) in a Transaction. Can a Transaction (BeginTrans ->
CommitTrans) encompass table changes made on two different forms? Or do the
table updates all have to be made together in the one form? If the latter,
any suggestions on how to do this?

For example, is this feasible:

(FormA)
wrk.BeginTrans
(update TableA)
(open FormB and update TableB and TableC)
(close FormB)
wrk.CommitTrans

This would require looping in FormA waiting for FormB to close (not a good
idea). Could use the Close event of FormB somehow to trigger FormA to
commit?
Thanks for any help.

Lyn.
May 6 '07 #1
1 1506
On Sun, 6 May 2007 17:05:29 +1000, Lyn <l.*******@iiNet.net.auwrote:

Transactions put severe restrictions on other use of the underlying
tables, so they should be run as quickly as possible. Therefore they
should never be controlled by user (in-)action.

TableA and TableB typically would have unrelated information, so it
generally is not true that a change in TableA would require an
associated change to TableB. If it does, that points to bad database
design.

-Tom.

>Hi,
I have two tables in a many-to-many relationship, linked by a third table.

TableA
RecNumA (Autonum)
[other fields...]

TableB
RecNumB (Autonum)
[other fields]

TableC (linking table
RecNumA (reference to primary key of TableA)
RecNumB (reference to primary key of TableB)

FormA is used to maintain records in TableA.
FormB is used to maintain records in TableB.

Whenever FormA is used to create or update a TableA record, FormB may
optionally be opened to make an associated change to TableB. TableC will
also be updated as necessary to link the TableA and TableB records.

Here (finally!) is my question. I would like to update all three tables
(when changed) in a Transaction. Can a Transaction (BeginTrans ->
CommitTrans) encompass table changes made on two different forms? Or do the
table updates all have to be made together in the one form? If the latter,
any suggestions on how to do this?

For example, is this feasible:

(FormA)
wrk.BeginTrans
(update TableA)
(open FormB and update TableB and TableC)
(close FormB)
wrk.CommitTrans

This would require looping in FormA waiting for FormB to close (not a good
idea). Could use the Close event of FormB somehow to trigger FormA to
commit?
Thanks for any help.

Lyn.
May 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
3
by: Robin Tucker | last post by:
Is it possible to wrap a transaction across 2 database? For example: BEGIN TRANSACTION .... alter something in Database_1 .... alter something in Database_2 COMMIT TRANSACTION or if...
5
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...
1
by: REB | last post by:
If I create a transaction object for rolling back a insert query in the on click event of a form button can the transaction be tracked across other functions? For example: private void...
2
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
3
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on...
9
by: John Sidney-Woollett | last post by:
Is it possible to use the dblink and dblink_exec features from inside pl/pgsql functions to mimic the behaviour of nested transactions by calling another function or executing some SQL via the...
2
by: Maris Janis Vasilevskis | last post by:
Hi, I wish to initiate a transaction and commit or rollback some screens later. I could not find a solution. The simplest idea, ViewState=MyTransaction , fails because ODBCTransaction is not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.