Have just tested this, and if no transaction statements exist in the script, 
and none come from the provider (FbConnection.BeginTransaction etc) then the 
statements appear to be committed. However, if no transaction is explicitly 
started, from either a statement in the script or from the provider, and a 
COMMIT statement is parsed from the script and applied with an FBCommand then 
an error occurs ("invalid transaction handle (expecting explicit transaction 
start)").

The scripts need to supply the commits as they are supplying the statements and 
know what to commit. The many scripts I use are also used by Delphi IBX 
components which provide an implicit transaction if one is not started, so the 
scripts just need to supply commits.

I am catching the commits in the .net exe and explicitly getting the provider 
to commit. But if there is no final commit in the script, and it is followed by 
another with a commit, then I get an error. I have no way of knowing once the 
script has finished if the explicit transaction is still active.

Does anyone use the FbScript component?


> To: firebird-net-provider@lists.sourceforge.net
> Date: Thu, 16 Aug 2012 11:18:23 +0300
> From: intelru...@unrealsoft.net
> Subject: Re: [Firebird-net-provider] Active transactions?
> 
> Hi,
> 
> I haven`t used scripts in a while but I think if it fails to Commit it  
> will throw an exception ...
> 
> > Hi all,
> >
> > Is there any way of determining if there is an active transaction being  
> > used
> > by an FbCommand? I have searched the properties of FbCommand,  
> > FbConnection,
> > FbTransaction, the net, and these forums but can find no answers.
> >
> > I am using a FbScript component and I cant be sure if the last script run
> > ends with a "commit" or not.
> >
> > If I try to commit a transaction that has already been committed I get a
> > "This Transaction has completed; it is no longer usable." error. And if I
> > try to start a transaction when there is already one active I get a "A
> > transaction is currently active. Parallel transactions are not  
> > supported."
> > error
> >
> > I'd be happy for an answer in any version of the provider. Am currently
> > using 2.0 and trying 2.5.
> >
> > Having something like FbConnectionInternal.HasActiveTransaction publicly
> > available is what I am after.
> >
> > Cheers,
> >
> > Perry
> >
> >
> >
> > --
> > View this message in context:  
> > http://firebird.1100200.n4.nabble.com/Active-transactions-tp4631687.html
> > Sent from the firebird-net-provider mailing list archive at Nabble.com.
> >
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Firebird-net-provider mailing list
> > Firebird-net-provider@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> 
> 
> -- 
> Using Opera's revolutionary email client: http://www.opera.com/mail/
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
                                          
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to