freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Eric Mountain" <e.mountain AT dev.amadeus.net>
- To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
- Subject: Re: JDBC bug?
- Date: Thu, 24 Feb 2000 20:47:20 +0100
(1) I can't reproduce this if I use the same
Statement object for UDPATE and SELECT: if it were the case it would be very
strange since the row is locked by the UPDATE and the SELECT is in the same
transaction. I won't even try to use 2 different Statement objects since
(provided autoCommit is false) I know that I will get that behaviour as it is
what I would expect: freetds allows you to have thread-safe Statements on the
same Connection by having a _physical_ connection to the database per Statement
object. So if you UPDATE on one Statement (and don't commit) and SELECT on
another Statement, then the SELECT will block until the UDPATE is commited
because they are in 2 different transactions. This is not a bug, this is
ACID.
(2) This is debatable as a bug. As mentionned above, freetds
implements thread-safe Statement on the same Connection by having a _physical_
connection to the database per Statement object. When you do
Connection.commit(), freetds issues a COMMIT TRAN on each _physical_ connection
owned by each Statement object created using the Connection object. As
part of Statement.close(), ROLLBACK TRAN is issued on the physical connection
for that Statement (well, I didn't check, maybe it isn't explicitly issued, but
the server will rollback any uncommitted open transaction when the Statement
closes its physical connection, same difference) which is why you loose your
update if you have not done Connection.commit() before doing
Statement.close().
Now, is (2) in violation of the JDBC spec? It's late,
I'm not checking now...
Cheers,
:E
|
-
JDBC bug?,
Betty Chang, 02/24/2000
- <Possible follow-up(s)>
- Re: JDBC bug?, Eric Mountain, 02/24/2000
- Re: JDBC bug?, Brett Knights, 02/24/2000
- Re: JDBC bug?, Craig Spannring, 02/24/2000
- Re: JDBC bug?, Brett Knights, 02/24/2000
- Re: JDBC bug?, Craig Spannring, 02/25/2000
- Re: JDBC bug?, Betty Chang, 02/26/2000
- Re: JDBC bug?, Eric Mountain, 02/29/2000
Archive powered by MHonArc 2.6.24.