Re: Support for XA



On Wed, Jun 17, 2009 at 09:15:49PM +0100, Tim Bunce wrote:
On Wed, Jun 17, 2009 at 01:53:36PM -0500, David Dooling wrote:
On Wed, Jun 17, 2009 at 01:08:26PM +0800, Matthew Watson wrote:
Does DBI ( specifically DBD::Oracle ) have any support for
distributed transactions (XA). I have a need to share an oracle
session between java and perl clients, this could be done in Oracle
11g via the DBMS_XA package, however it seems like it should be
doable in earlier versions via OCI, is this support at all?

UR can do this, but not directly at the database level. The bad part
of this is that it does not use Oracle's methodology to do this. The
good part is that it will work across databases residing on different
RDBMS's.

http://search.cpan.org/search?query=UR&mode=module

Basically, UR's object cache / Context acts as a software transaction
that sits on top of whatever database transactions are active through
the data sources. So what ends up happening is that you can load
objects that come from multiple databases, and when you tell the
Context to commit, it executes the SQL separately to each database in
its own transaction. After all the databases' SQL statements have
completed successfully, it tells each DB transaction to commit.

If any of the SQL fails, then all the DB transactions are rolled back.

If two databases are being used, and the commit to the first succeeds
and the commit to the second fails, how does it "rollback" the first
commit?

If the SQL is successful and the commit fails, an error is thrown.
That requires some manual intervention (much like a failed commit for
a transaction on a single database). Theoretically, the STM engine
could attempt to undo what it had done on the successful commits, but
that may be dangerous and not what the developer would want.

--
David Dooling
http://www.politigenomics.com/
.



Relevant Pages

  • Re: Locking and Delay in a Bottleneck
    ... that should avoid the gap issue on rollback, ... SQL Server MVP ... the saving transaction, this journal voucher is having a header table ... number in a table whereupon you commit. ...
    (microsoft.public.sqlserver.programming)
  • Re: Driver AutoCommit issue
    ... I am using the container managed transaction and I expect the container to handle that for me. ... Is there different driver class that i have to use in the connection pool configuration. ... Why I am saying the DML always gets committed is when I step thought the code I can see the updated data in the database immediately after the callable statement is executed Even before the EJB method that invoked the call is completed. ... I set the auto commit to false on connection as soon as I get the connection from the datasoruce. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Trigger does not seem to fire from front end or enterprise manager
    ... there is no need to even do COMMIT in a trigger. ... > the transaction will be committed as the statement completes. ... > against the inserted and deleted tables inside your trigger code. ... run a profiler trace and you will see what SQL EM submits. ...
    (microsoft.public.sqlserver.programming)
  • Re: A lazy-committing database object with curry?
    ... > I'm writing a database helper class that represents records in a SQL ... > commit the changes all at once. ... transactionally, and the transaction fails, your in memory objects will ...
    (comp.lang.python)
  • Re: commit
    ... I am using SQLite, and I want to select the maxfrom a certain ... gives an error telling that the database is locked if in that moment ... allowing an update until the "transaction" finishes. ... Only then does process A commit its transaction and the rowA becomes ...
    (perl.beginners)