Free TDS/JDBC Driver problem .Help

Rajeev rajeev.k at recruitlive.com.au
Thu Jul 12 01:08:30 EDT 2001



Kevin,
Hi

As a said about the commit/Rollback : I have commented out the rollback() in
the close() of Statement .So transaction is working but suppose I have to
insert more than one record in a table I dont know it simply hangs . I am
not clear as to what the driver actually does .If u can explain will be
really helpful

Ta,
Take care

cheers
Rajeev

-----Original Message-----
From: bounce-freetds-132882 at franklin.oit.unc.edu
[mailto:bounce-freetds-132882 at franklin.oit.unc.edu]On Behalf Of Kevin
Fries
Sent: Wednesday, July 11, 2001 2:33 AM
To: TDS Development Group
Subject: [freetds] Re: Free TDS/JDBC Driver problem .Help


Rajeev,

Regarding commit/rollback with the driver, I noticed the same problem.  It
turns out to be an interesting choice the author(s) made regarding when to
terminate a transaction.  I've never seen this behavior on any other
driver (oracle/mysql/allaire/merant/Inetd) but...

Check out the source code to Statement.java  You'll see that it will issue
a rollback call upon close of the statement.  This means you have to
explicitly call commit() using the same statement you performed your work
on in order to keep the changes.  That's pretty odd, IMHO.

Locally, I've re-coded the source to issue the explicit rollback only upon
close of the Connection.  My version still loops through each Statement in
the connection, rolling back each.  But when Connection.commit() is
called, my version rolls through each Statement and commits it.  I think
this is much closer to the behavior of other JDBC drivers.

I'm still having some odd locking issues, and struggling with issuing a
PreparedStatement.setString() on anything longer than 2k (actually, 2015
bytes) but changing this commit behavior improved things for me quite a
bit.

Related to the commit, I wanted to ask this of the JDBC crew.  Has anyone
compared issuing the "set implicit_transactions on" call to issuing a
specific "BEGIN TRAN" call?  I don't know if this works with sybase, but
this is the way other commercial drivers work, so I wonder if some locking
issues I have might go away if I recoded it this way?  Just curious.

hth,
Kevin Fries
kelfink at yahoo.com

---
You are currently subscribed to freetds as: [rajeev.k at recruitlive.com.au]
To unsubscribe, forward this message to
$subst('Email.Unsub')




More information about the FreeTDS mailing list