Subject | Re: [Firebird-Java] Concurrent updates - Retry not allowed without commit or rollback |
---|---|
Author | Nitin Shenoy |
Post date | 2003-09-23T09:18:23Z |
Hi Nickolay,
Thanks for your reply.
mechanism. I am questioning why I have to commit or
rollback the transaction after Firebird reports an
update conflict? Should a client application not be
allowed to execute the same sql on the existing
transaction without having to commit/rollback?
Firebird will report an update failure once the first
update commits. So wait/nowait only differ in when
Firebird reports a conflict, right?
I have tried wait and nowait in this loop. I have also
tried setting connection properties like you
indicated....except I used "isc_" prefix. Maybe, thats
what I am doing wrong.
in this list.
Thanks for the help.
Nitin
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Thanks for your reply.
> This behaviour is AS DESIGNED. Firebird doesn't takeI do not have any issue with the optimistic locking
> implicit
> pessimistic locks for the period of physical record
> update for various
> reasons (mainly performance-related in clustered
> environment, AFAIU).
mechanism. I am questioning why I have to commit or
rollback the transaction after Firebird reports an
update conflict? Should a client application not be
allowed to execute the same sql on the existing
transaction without having to commit/rollback?
> Use explicit pessimistic locks andEven if I specify tpb_wait, If I understand correctly,
> isc_tpb_read_committed+isc_tpb_wait+<whatever>
> isolation mode to avoid
> the error or handle this error yourself via retring
> statement
> (isc_tpb_read_committed modes) or transation
> (isc_tpb_concurrency).
Firebird will report an update failure once the first
update commits. So wait/nowait only differ in when
Firebird reports a conflict, right?
> But retry should handle the error in"jdbc:firebirdsql:localhost/3050:TGDB?TRANSACTION_READ_COMMITTED=isc_tpb_write,isc_tpb_read_committed,isc_tpb_no_rec_version,isc_tpb_nowait";
> isc_tpb_read_committed modes so
> you possibly setting Jaybird TPB modes incorrectly.
I have tried wait and nowait in this loop. I have also
tried setting connection properties like you
indicated....except I used "isc_" prefix. Maybe, thats
what I am doing wrong.
> My TPB managementI will try without the "isc_" prefix and report back
> code looks like this:
>
> Properties conProp = new Properties ();
> conProp.put ("user", user);
> conProp.put ("password", password);
> /* Firebird JCA-JDBC driver (Jaybird)
> parameters */
> conProp.put ("lc_ctype", "WIN1251");
> conProp.put ("TRANSACTION_SERIALIZABLE",
> "concurrency,nowait");
> conProp.put ("TRANSACTION_REPEATABLE_READ",
> "consistency,wait");
> conProp.put ("TRANSACTION_READ_COMMITTED",
> "read_committed,rec_version,wait");
> con = DriverManager.getConnection(URL,
> conProp);
in this list.
Thanks for the help.
Nitin
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com