On Tue, 15 Aug 2000, Michael Peppler wrote:

> Matt Sergeant writes:
>  > On Tue, 15 Aug 2000, Vladislav Safronov wrote:
>  > 
>  > > Ok. I think, the answers clear the problem, but I have yet more question.
>  > > 
>  > > What can you say about this code? is it ok (overwriting previous handle)?
>  > 
>  > [snip]
>  > 
>  > Well it depends on the DBMS. For example Sybase might not like it if you
>  > haven't read everything from the $sth first - it will bite you in the bum
>  > with locks. Others will be fine. So just be careful...
> 
> Actually what happens with Sybase is this:
> 
> If $sth has pending results when prepare() is called DBD::Sybase opens 
> a new connection (because it sees that the $dbh already has an active
> $sth). When the return value from prepare() is assigned to $sth the
> DESTROY method for the old $sth is called, which cancels the previous
> query. 
> 
> So I think that you *should* be safe from deadlocks, but the problem
> will be getting additional connections created, which is not really
> optimal. 

Isn't there something different happening when AutoCommit = 0 though?

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org

Reply via email to