Subject | Re: [firebird-support] Re: Invalid Transaction Handle issue |
---|---|
Author | Helen Borrie |
Post date | 2005-02-06T11:46:47Z |
>--- In firebird-support@yahoogroups.com, "d_dude_2003"At 09:27 AM 6/02/2005 +0000, Olivier Lucaes wrote:
><d_dude_2003@y...> wrote:
> >
> > Hi folks,
> >
> > I have an application in D7 which uses IBExpress. Backend is
> > FireBird 1.5. I am getting "Invalid Transaction Handle (explicit
> > transaction start needed)" error now when opening a query
> > SELECT * FROM SOMETABLE.
> >
> > Is there any workaround available? At which moment do i need to
> > start an transaction for this SELECT? Or its a bad idea to use
> > IBExpress with FireBird 1.5 and in multi threaded environment it
> > wouldnt work well?
> >
> > Thanx.
>Hi,Do you both understand that TIBDatabase, unlike the BDE TDatabase, does not
>I got the same problem when i have added a second database component
>inside the same application... do tou have also more than one
>connection active in the same time ?
>Olivier
have a transaction embedded in it?
If you have one TIBDatabase connection, you must have at least one
TIBTransaction. If you have two TIBDatabases then the second one either:
-- must have a separate TIBTransaction if you are going to connect to it
for a separate task;
or
-- must be hooked up to the same transaction if you are going to do a task
that spans two databases, e.g. query tables in one database and use its
data to update tables in the other.
You can have multiple transactions running inside a single connection, with
multiple data access objects within the same transaction (except for
clientdatasets, which are strictly limited to be the only data access
object in a transaction).
You have to assign a transaction to the database[s] you want to
query. Then each one of your data access objects has to work in the
context of one transaction and one database.
Don't use two TIBDatabase objects in a single session to connect to a the
same database (I think this was your problem yesterday...). If you
multi-thread connections, you must isolate the entire scenario in its own
"session instance", with its own database, transaction and data access
objects. You can't access the "business" of one transaction from another
transaction.
Don't use the IPServer ("Windows local" protocol) to connect multi-threaded
sessions.
As to IBX's future with Firebird, start thinking about alternatives
now. There is no likelihood that Borland will allow IBX to support
Firebird features. It is only a question of time until IBX becomes
unfeasible for applications interfacing to Fb.
btw, as a rule, don't ask Delphi questions here. I answered it because
weekends are relatively quiet times. IBObjects and FIBPlus (which DO
support Firebird) and other Delphi interfaces for Fb have their own
lists. You also might get help on Borl's InterBaseXpress newsgroup if you
don't mention the F-word....
./heLen