Re: Freetds perl limitation

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Tue, 28 Jun 2011 10:33:18 -0400
Ravi Krishna <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.