Skip to Content.
Sympa Menu

freetds - Re: JDBC bug?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Spannring <Craig.Spannring AT kampong.aedinc.net>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: JDBC bug?
  • Date: Thu, 24 Feb 2000 15:29:57 -0700 (MST)


Brett Knights writes:

>
> But not correct:
> Statements created from the same connection object shouldn't block each
> other. They are all part of the same transaction and should have the
> same view of the database.

With the TDS protocol you can have only ONE outstanding result per
connection. Since most people want multiple com.java.sql.Statement per
com.java.sql.Connection the driver is pretty much forced to use a
separate connections for each statement.

> I don't know it that is per spec but
> that is

You should read the JDBC spec.


> how all systems I have ever used work. You should be able to begin a
> transaction on a connection , create and close any number of statements
> and then commit or roll-back the entire transaction.

The way you suggest implementing the com.java.sql.Statement interface
would not permit you to create and use more than one simultaneous
statement per connection.


> The way freetdsJDBC is currently implemented your statements get rolled
> back if you close them without committing. Essentially the user has to
> treat a statement in freetdsJDBC as they would a connection using any
> other driver. In my mind this nulls any thread safe benefit you might
> have by the strategy that has been adopted so far.

The strategy adopted "so far" has nothing to do with thread safeness.
It is simply to allow the user to have multiple statements open per
connection. Thread safeness is an important concern, but it did not
drive this descision.

If you don't like the strategy, you're free to implement whatever
strategy you would like.




> Also you can't (I can't anyway) call setAutoCommit(true). When I try I
> get a "protocol confusion" message. (I posted this to linuxCare - is
> that working?)


Apparently not. I never received the notification. Send a test case
that demonstrate the problem to the address listed in the README file
and I'll take a look at it.


--
=======================================================================
Life is short. | Craig Spannring
Bike hard, ski fast. | Craig.Spannring AT aedinc.net
--------------------------------+------------------------------------
Any sufficiently horrible technology is indistinguishable from Perl.
=======================================================================





Archive powered by MHonArc 2.6.24.

Top of Page