Skip to Content.
Sympa Menu

freetds - Re: Too many connections (and threading)?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Eric Mountain" <eric AT minouche.demon.co.uk>
  • To: <joel_trunick AT dell.com>
  • Cc: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Too many connections (and threading)?
  • Date: Sat, 10 Jul 1999 14:54:08 +0200


Joel,

I assume you are talking about the JDBC version of FreeTDS? (If not, ignore
what I'm going to say!)

The FreeTDS JDBC driver opens a new connection for every createStatement,
even if you have only one getConnection(). I think you'll find this is the
source of your problems. When you close a Statement object, the connection
it was associated with is returned to the connection pool for reuse.

You can use the same Connection object across threads since it in fact hides
multiple connections (see above). You must be careful though in using a
Statement object across threads - this is not safe (telltale error is
Function Sequence Error).

Cheers,
Eric

-----Original Message-----
From: joel_trunick AT dell.com <joel_trunick AT dell.com>
To: TDS Development Group <freetds AT franklin.oit.unc.edu>
Date: Friday, 09 July, 1999 20:41
Subject: [freetds] Too many connections (and threading)?


>Our database connection is created using a singleton pattern. This is only
>one getConnection() is performed. However, we seem to get a lot of
>connections to the database... What gives?
>
>Also, can I use the same connection across threads? I assume it is safe?
>
>Thanks,
>Joel
>
>---
>You are currently subscribed to freetds as: eric AT minouche.demon.co.uk
>To unsubscribe, forward this message to
$subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page