|Subject||Re: FB, Delphi 7, IB components and transactions|
|Author||Svein Erling Tysvær|
> Hi all,Hi Diego!
> I am a newbie when it comes to transactions, so please excuse myWell, almost everything within Firebird happens within a transaction,
> ignorance when it comes to transactions.
so you have to learn a bit about them.
> I am using FB 1.5.2, with Delphi 7 and the IB components. MyProbably because of transactions...
> question is, why when I insert a record into a table don't I see it
> in another running program?
> I have a small test application with a query which selects a countWell, I haven't seen any commit of the transaction yet, that makes it
> of records from a table. On a form I show this number when I click
> the Refresh button. I have another button which inserts a new record
> into the table. So my form has the following components:
> IBQuery1 - which does a SELECT COUNT(*) on the table
> IBQuery2 - which inserts a record
> IBDatabase - used by both queries
> IBTransaction - used by the IBQuery1, IBQuery2 and IBDatabase
> When I click the Refresh button I execute the following code:
> When I click the Insert button I execute the following code:
> I then run two copies of this test program. I insert a record in one
> instance of the program, click refresh and I see the record count
> increase. I click Refresh on the other instance of the application
> and the count does not change.
similar to writing a letter to your friend and upon asking, he says he
hasn't received it. Upon asking at the postoffice you discover they
expect you to actually send the letter.
After doing this, your friend still says he hasn't received it. Asking
at his local post office, he discovers that he actually has to look at
his own mailbox, it is not enough that he once looked at it a few
months back. Checking his mailbox again, he finds your letter.
> Can this behavior be changed? I changed the transaction component toWell, I think some of it can be changed by the transaction settings,
> be read-commited, but that did not change the behavior. Maybe this
> is all about a different mindset and how one works with IB/FB? Are
> there any articles which talk about this? Maybe I need to try other
> components which work differently from a programming point of view?
more specifically whether or not you see changes that have been
committed after you started your transaction. But there is no way to
make visible outside your own transaction anything that hasn't been
committed. Take a look at this article: http://www.ibobjects
com/docs/ti_Transactions.ZIP, even though IBObjects is different from
the Borland components I hope it should give you an idea.
Good luck in learning transactions,