Transaction configuration with the ADO.NET Data provider for Firebird

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Transaction configuration with the ADO.NET Data provider for Firebird

Marc Bettex
Hi,

I'm currently using the ado.net firebird client 2.5 and I have some problems
with the configuration of the transactions. I only found some outdated
documentation from version 1.7 on the web, so I was hoping that someone
could point me toward some up to date documentation or tell me how to solve
my problem.

What I want to achieve, is to create a transaction with the method
FbConnection.BeginTransaction(FbTransactionOptions) that
- can write data to one or more tables
- locks the tables it want to writes at the start of the transaction to
avoid deadlocks
- waits if the tables it want to use are already locked by another
transaction

I thought that I should use the following call to create the
FbTransactionOptions object:

new FbTransactionOptions()
{
        TransactionBehavior = FbTransactionBehavior.Concurrency |
FbTransactionBehavior.Wait | FbTransactionBehavior.LockWrite |
FbTransactionBehavior.Protected
};

But this calls throws an exception with the message "invalid parameter in
transaction parameter block". I tried several other combinations that looked
like they should make sense to me, but I got the same error every time.
Moreover, at this point, I am not too sure of how to specify which table I
want to lock. From what I read in my book about Firebird, it is possible to
do it, but I'm not sure if the data provider allows it and then how to do
it.

Thank you very much,

Marc Bettex



------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Jiri Cincura
On Tue, Aug 3, 2010 at 10:36, Marc Bettex <[hidden email]> wrote:
> new FbTransactionOptions()
> {
>        TransactionBehavior = FbTransactionBehavior.Concurrency |
> FbTransactionBehavior.Wait | FbTransactionBehavior.LockWrite |
> FbTransactionBehavior.Protected
> };

You can't specify table for locking, it's not supported by provider.
So the last two should be removed. And you can lock your table, kind
of, with "FOR UPDATE WITH LOCK" statement in your select.

--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Marc Bettex
Thank you for your quick answer,

Marc

-----Message d'origine-----
De : Jiri Cincura [mailto:[hidden email]]
Envoyé : mardi 3 août 2010 13:55
À : For users and developers of the Firebird .NET providers
Objet : Re: [Firebird-net-provider] Transaction configuration with the
ADO.NET Data provider for Firebird

On Tue, Aug 3, 2010 at 10:36, Marc Bettex <[hidden email]> wrote:
> new FbTransactionOptions()
> {
>        TransactionBehavior = FbTransactionBehavior.Concurrency |
> FbTransactionBehavior.Wait | FbTransactionBehavior.LockWrite |
> FbTransactionBehavior.Protected
> };

You can't specify table for locking, it's not supported by provider.
So the last two should be removed. And you can lock your table, kind
of, with "FOR UPDATE WITH LOCK" statement in your select.

--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

----------------------------------------------------------------------------
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

pierre.arnaud
In reply to this post by Jiri Cincura
Hello Jiri,

> On Tue, Aug 3, 2010 at 10:36, Marc Bettex <[hidden email]> wrote:
> > new FbTransactionOptions()
> > {
> >        TransactionBehavior = FbTransactionBehavior.Concurrency |
> > FbTransactionBehavior.Wait | FbTransactionBehavior.LockWrite |
> > FbTransactionBehavior.Protected
> > };
>
> You can't specify table for locking, it's not supported by provider.
> So the last two should be removed. And you can lock your table, kind
> of, with "FOR UPDATE WITH LOCK" statement in your select.

Would you consider adding table locking in the provider ? Is this something
difficult to implement ?

Pierre



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Jiri Cincura
On Sat, Aug 7, 2010 at 14:45, Pierre Arnaud <[hidden email]> wrote:
> Would you consider adding table locking in the provider ? Is this something
> difficult to implement ?

Put it into tracker and I'll look at it. From quick research it
shouldn't be difficult.

--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Jiri Cincura
On Sat, Aug 7, 2010 at 15:41, Jiri Cincura <[hidden email]> wrote:
> Put it into tracker and I'll look at it. From quick research it
> shouldn't be difficult.

Done. You can grab it from weekly builds place and test.

--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Jiri Cincura
On Sun, Aug 8, 2010 at 19:10, Jiri Cincura <[hidden email]> wrote:
> Done. You can grab it from weekly builds place and test.

And maybe http://blog.cincura.net/231910-fbtransaction-changes-to-support-tables-locking/
as a quick start.

--
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

pierre.arnaud
In reply to this post by Jiri Cincura
Thank you for your very quick response time ! Is there any way we can
provide financial support for the Firebird.NET development ? Or maybe
purchase you a few books on Amazon ?

Pierre

> -----Original Message-----
> From: Jiri Cincura [mailto:[hidden email]]
> Sent: Saturday, August 07, 2010 3:41 PM
> To: For users and developers of the Firebird .NET providers
> Subject: Re: [Firebird-net-provider] Transaction configuration with the
> ADO.NET Data provider for Firebird
>
> On Sat, Aug 7, 2010 at 14:45, Pierre Arnaud <[hidden email]> wrote:
> > Would you consider adding table locking in the provider ? Is this
> something
> > difficult to implement ?
>
> Put it into tracker and I'll look at it. From quick research it
> shouldn't be difficult.
>
> --
> Jiri {x2} Cincura (x2develop.com founder)
> http://blog.cincura.net/ | http://www.ID3renamer.com
>
> --------------------------------------------------------------------------
> ----
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Firebird-net-provider mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Transaction configuration with the ADO.NET Data provider for Firebird

Helen Borrie
At 03:06 PM 9/08/2010, Pierre Arnaud wrote:
>Thank you for your very quick response time ! Is there any way we can
>provide financial support for the Firebird.NET development ?

http://www.firebirdsql.org/index.php?op=ffoundation&id=contributions

Helen (Secretary, Firebird Foundation)


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Loading...