in reply to CDBI and multiple databases

A counter question:

Can you do transactions spanning multiple connections? I don't know of any database server that would allow you to do that.

Unless this is possible, I think you erred by organizing in multiple databases.

Liz

Replies are listed 'Best First'.
Re: Re: CDBI and multiple databases
by mpeppler (Vicar) on Mar 21, 2004 at 16:05 UTC
    Class::DBI may not be able to do this (and maybe MySQL can't handle it) - but with Sybase I can have a single transaction span multiple databases on a single connection. You simply have to fully qualify the name of the tables with the database:
    begin tran update db1.dbo.foo set bar = 1 where baz=2 delete db2.dbo.bar where baz=2 commit tran
    (where "dbo" above is the table owner - in this case the "database owner").

    Michael

      MySQL can handle multiple database transactions in a single connection as well.

      The problem is that Class::DBI is forcing multiple connections, thus preventing the transaction from working properly.

Re: Re: CDBI and multiple databases
by water (Deacon) on Mar 21, 2004 at 15:51 UTC
    Can you do transactions spanning multiple connections?
    No, clearly not.
    I don't know of any database server that would allow you to do that.
    Agreed.

    But if we could get all the DBI handles out of Ima::DBI, we're thinking we could roll each handle back if any piece failed...

    Not sure, though, how to get at all the handles.