RE: About prepared statements asnd transactions....

"Orton, Yves" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <598758B8A22EB34B8C0B0CF463371C09EBBD0D@ms-fra-exmb01.de.mcilink.com>
Edward J. Sabol wrote on Wednesday, October 12, 2005 1:01 AM
> Yves Orton wrote:
> > The main issue for me is that currently prepared handles +
> > transasctions are dangerous.
> 
> They are? How so exactly? I've used prepare_cached() within 
> transactions in several Web applications in a mod_perl environment for a 
> couple years now and I haven't encountered any problems.
> 
> Do you mean "*active* statement handles"? Like when you have an active
> statement handle and then you prepare/execute another 
> statement handle which transparently opens up a separate DBI connection? 

Yes this is precisely the issue I mean.  Dangerous as a description is
perhaps a touch drammatic, but not wrong.

> Because that can lead to inconsistent transactional behavior. 

Yep. And if you've missed the bit of the docs that explains this behaviour
extremely perplexing. :-)

> It would be really nice if DBD::Sybase could better support multiple
active sth's over 
> a single dbh. I know this is still one of the problems preventing easy
porting 
> of Bugzilla to Sybase.

This is exactly what I was trying to address. 

> While, it's arguably poor program design to need multiple 
> active statement handles, most every DBD supports it *except* for
DBD::Sybase. 
> DBD::Mysql and DBD::Pg (for older versions of PostgreSQL only) emulate the

> capability of having multiple active sth's per dbh by reading all the data
from an
> unfinished sth into memory when a second sth is executed. I 
> suggested adding similar emulation of this capability to DBD::Sybase to 
> Michael in February 2004, but nothing came of it, AFAIK.

And I guess that's exactly what I want. I think tho I misunderstood the
problem and therefore suggested the incorrect remedy. I thought that you
could have multiple active statements so long as they don't use
placeholders, so avoiding them seemed the solution, I guess im wrong there? 

Yves
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.