Skip to Content.
Sympa Menu

freetds - Re: [freetds] Freetds perl limitation

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] Freetds perl limitation
  • Date: Wed, 29 Jun 2011 07:00:08 -0400

On Tue, 28 Jun 2011 10:33:18 -0400
Ravi Krishna <rkusenet AT hotmail.com> wrote:

> Currently I see following limitation in perl dbd with freetds
>
> 1. Can not prepare more than one statement concurrently.
> 2. Can not turn off autocommit if more than database handle is
> created in the same program.

http://www.freetds.org/faq.html#pending
http://www.freetds.org/mars.html

I never bumped into the limitations you describe because my DBI
programs never have more than one statement handle per connection.

I hope the above makes clear why.

> Do these restriction exist if we write our own C programs with
> freetds, or it is only in perl dbd with freetds.

The TDS protocol requires the client to finish processing query results
before the server will accept another query. IOW, the protocol
supports only one active query per connection.

Your question implies you'd like to have a set of statement handles,
on the same connection, all prepared, and be able to execute them under
transaction control. I see no reason the server and ODBC driver
couldn't support that, but I'm not sure they do. If I may, though, I'd
suggest you consider moving that kind of logic to a stored procedure.
In most cases, that would simplify the design and improve performance,
not least because it would minimize the time locks are held between
commits.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page