Subject | Re: [firebird-support] Deadlock when 2 session update the same 01 row |
---|---|
Author | André Knappstein |
Post date | 2012-11-27T13:11:28Z |
Somewhere along this:
FbTransactionBehavior t_behaviour;
FbTransactionOptions t_options;
t_behaviour = FbTransactionBehavior.NoWait;
t_options.TransactionBehavior = t_behaviour;
FbConnection conn = new FbConnection();
conn.BeginTransaction(t_options);
have fun!
André
FbTransactionBehavior t_behaviour;
FbTransactionOptions t_options;
t_behaviour = FbTransactionBehavior.NoWait;
t_options.TransactionBehavior = t_behaviour;
FbConnection conn = new FbConnection();
conn.BeginTransaction(t_options);
have fun!
André
> Thanks for your reply,
> I am using VS2005 (FirebirdSqk,Data.FirebirdClient), how can I change
> behavior of the Database the same as in Oracle?
>
> Best Regards,
>
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of Svein Erling Tysvær
> Sent: Tuesday, November 27, 2012 4:07 PM
> To: 'firebird-support@yahoogroups.com'
> Subject: RE: [firebird-support] Deadlock when 2 session update the same 01
> row
>
>
>>I am newbie to Firebird, I am working on Oracle and porting a small module
> to Firebird. We
>>face with very strang problem:
>>
>>When session A and B update a row in a table at the same time. If A goes
> first, and while A
>>does not commit or rollback yet, B will update the same row. In Oracle, B
> will be blocked
>>until A commit or rollback without any error. But In Firebird, B will get
> Deadlock
>>immediately.
>>
>>Can I config FB to do exactly like Oracle does? Or, It is a bug?
> Hi and welcome, Nguyen!
> No, it is no bug. This is called 'lock resolution' and belongs to your
> transactions (strictly speaking, this is a lock conflict, not a deadlock).
> So, you could have isc_tpb_nowait on transaction A and isc_tpb_wait on
> transaction B and then transaction A would behave like you report your
> system is doing, whilst transaction B would behave as you would like it to
> behave.
> How to set these things depend on what kind of components you use. Using IB
> Objects, I would simply set TIB_Transaction.LockWait to true (though I've
> never actually done this myself), other components will have different ways
> of doing this.
> HTH,
> Set
> [Non-text portions of this message have been removed]
> ------------------------------------
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
> Also search the knowledgebases at http://www.ibphoenix.com
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links