Board index » delphi » invalid transaction handle (expecting explicit transaction start)

invalid transaction handle (expecting explicit transaction start)

I'm experiencing very strange problem. I've created dll for interbase
connection, and in initialization section I've putted DataModule.Create and
OnCreate -> ibDatabase.Connected := True; -> ibTransaction.Connected :=
True. Logically, in finalization section I've tried to put DataModule.Free
and OnDestroy -> ibTransaction.Connected :=
False-> and that is the place where I'm receiving message from subject. D6,
IB 5.6.

Can somebody help me with these strange problem?

Thanks in advance
Aleksandar

 

Re:invalid transaction handle (expecting explicit transaction start)


Hi Bojidar,
thanks for such a quick response.

Quote
> The sollution that will make things work is to use
> ibTransaction.StartTransaction and ibTransaction.Commit at end,
> But this mean that transaction will be held open too much time, so
consider
> redesign the application.

I did it with explicit starttransaction and commit, but then I've received
message:
'invalid database handle (no active connection)', on ibDatabase.Connected :=
False.

I'm completely in dark...

Do you have any other suggestion?

TIA
Aleksandar

Re:invalid transaction handle (expecting explicit transaction start)


Quote
"Aleksandar Galovic" <agalo...@uns.ns.ac.yu> wrote in message

news:3d874a80@newsgroups.borland.com...

Quote
> The solution was really trivial.

> It only took unchecking optimization in project settings and error-
> disappeared.

If turning off optimization for the compiler "fixes" it, then the fix is
liable to bite you at some later date. It means there is still technically a
problem somewhere and the fix is merely masking it.

--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
It used to be that other people's achievements were considered an
inspiration, not a grievance.

Re:invalid transaction handle (expecting explicit transaction start)


Quote
Aleksandar Galovic wrote:

> Hi Wayne,

> > If turning off optimization for the compiler "fixes" it, then the fix is
> > liable to bite you at some later date. It means there is still technically
> a
> > problem somewhere and the fix is merely masking it.

> I'm completely aware about that,
> but- the problem is somewhere in IBX 5.03...

Or in your code.  You are probably building from the dcu's (you should not be
building directly from the source unless you have a very good reason too) in
which case that switch does nothing since the binaries for IBX are already
created and is affecting your written code, not the IBX code itself.

Quote
> Aleksandar

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The bond that links your true family is not one of {*word*76}, but of respect and joy
in each others life.  Rarely do members of one family grow up under the same
roof.   (R Bach)

Re:invalid transaction handle (expecting explicit transaction start)


Hi Jeff,

Quote
> Or in your code.  You are probably building from the dcu's (you should not
be
> building directly from the source unless you have a very good reason too)
in
> which case that switch does nothing since the binaries for IBX are already
> created and is affecting your written code, not the IBX code itself.

I know you are right,
but that was the only way which I've found to bypass my problem.
I don't do anything special, and error appear when I try to disconnect
database- Database.Connected := False.
I would really like to find the cause for that annoying error.

Thanks
Aleksandar

Other Threads