Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Scott Zetlan" <scottzetlan at aol dot com>
Subject: RE: Can transactions span databases?
Date: Nov 8 2001 10:35PM

> -----Original Message-----
> From:
> []On Behalf Of Michael Peppler
> Sent: Thursday, November 08, 2001 5:08 PM
> To: SybPerl Discussion List
> Subject: Re: Can transactions span databases?
>  > 1) Is the scope of an explicit transaction the data server or
> the database?
> The data server (i.e. the *connection*).

Well, for the sake of precision, the scope of a transaction is probably
confined to a Sybase context, but that should be transparent to you unless
you start doing things like
$dbh1 = new Sybase::DBlib "user", $password;
$dbh2 = $dbh1->new "user2", $password2;

Then it would be a question of the back-end implementation (i.e., the XSubs)
and whether the module allocates a brand new connection, just a new context,
or simply creates a new pointer to the existing context.  I'm guessing that
you get a brand new connection, so it's not an issue, really.

In any case, when working with the DBLibrary using C/C++, you'll find that
explicit transactions probably don't survive a change in context; i.e., a
command allocated under one context cannot begin a transaction that a
command allocated under a different context commits/rolls back) -- I think.
I haven't tried it yet :)