Subject Re: [IBO] Managing Transactions
Author Helen Borrie
Burak,

At 03:06 PM 24-08-01 +0300, you wrote:
>Hi All...
>
> I Plan to built a heavy Accounting Program with Interbase and IBObjects but I have a real Problem Transactions. My Applications works MDI but a form can be opened once a time. Now I'm using only one Transaction object. For example The Order or Invoice modules can run at a time each modules updates deletes fires tons of functions that made DB write and delete. It's nearly impossible to handle them healty so I have to use transactions.

In IB/Firebird everything you do happens in transactions. There are two Tech Info sheets on the web site which will help you to understand transactions.

See http://www.ibobjects.com/TechInfo.html

"Working with Transactions" and "Transaction Tutorial"

>
> I think When a user opens Invoice module and selects "NEW" I have to get a transaction number and use the number in all functions transactions

No. The client program gds32.dll opens the transaction for you and gets a transaction handle from the server. IBO encapsulates all of the behaviour for handling that and surfaces it in a container class name TIB_Transaction. One of these is embedded in the TIBODatabase component. It is also possible to add further transaction instances using the TIBOTransaction component. With the "native IBO" components, you have a TIB_Database or a TIB_Connection and you can add further TIB_Transaction objects to them.

>, then if user preses "update" for the job I must commit all the changes to database that have the same transaction number.

No, you do not have to be concerned about the transaction number - the transaction component takes care of the handle. Each of your dataset objects is connected to a transaction object either by default or through its IB_Transaction property. In the case of the TIBO* components, this association is made by selecting your IBODatabase in the DatabaseName property of the dataset.

With the TIBO* components, you would call the COMMIT method of the IBODatabase.

>Or selects Cancel I have to do a RollBack operation. Think that all items at detail update fires 15 Functions.

Similarly, you would call the ROLLBACK method of the IBODatabase.

>"Do you think Firebird/Borland Interbase suitable for this kind of Applications ?"

Definitely! We would not be here if it were not so!

Regards,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________