Transaction problem...new to using IBDAC
Posted: Mon 01 Feb 2010 22:55
Hi All,
It appears as if IBCConnection automatically controls transactions. I'm wondering how to explicitly call a transaction in the following instance.
I have a point of sale module. When I enter the POS module, I open queries to allow users to pick items from the inventory, to select a list of active salespeople, etc. From what I've read here in the forums, simply opening a query will cause the IBCConnection to start a transaction.
My problem is that I need the data in those datasets to be active, but when I go to post the POS items to the database, I want to explicitly begin a transaction that I can rollback in case there is a problem. For instance, I need to post the items to my client_transactions table, possibly update client data if there is a client associated with the POS sale, write data to my receipt table, etc.
I need to wrap a transaction around these specific actions, only, in case something bombs out. At the moment, when I call the MyIBCConnection.StartTransaction before I get ready to post out the sale, it errors because there is already a transaction in progress due to the opening of the datasets.
Can anyone tell me the proper way to do this with IBDAC?
Thanks in advance for any responses.
It appears as if IBCConnection automatically controls transactions. I'm wondering how to explicitly call a transaction in the following instance.
I have a point of sale module. When I enter the POS module, I open queries to allow users to pick items from the inventory, to select a list of active salespeople, etc. From what I've read here in the forums, simply opening a query will cause the IBCConnection to start a transaction.
My problem is that I need the data in those datasets to be active, but when I go to post the POS items to the database, I want to explicitly begin a transaction that I can rollback in case there is a problem. For instance, I need to post the items to my client_transactions table, possibly update client data if there is a client associated with the POS sale, write data to my receipt table, etc.
I need to wrap a transaction around these specific actions, only, in case something bombs out. At the moment, when I call the MyIBCConnection.StartTransaction before I get ready to post out the sale, it errors because there is already a transaction in progress due to the opening of the datasets.
Can anyone tell me the proper way to do this with IBDAC?
Thanks in advance for any responses.