FW: Q: Transactions to multiple connections/datasources
Pierre Awaragi <pierrea <at> email.com>
2003-11-07 17:17:27 GMT
Hi,
Thanks already for the fast responses. Given my inexperience with
SimpleORM, is it possible to get some sample code or at least some
instructions as to which functions/classes one must referre to?
This also brings the question to: if you have flushed a transaction/sql
statement successfully, does that mean that when it is committed,
success is guaranteed? If not, then flushing two statements and then
commiting is the same as the original delemma.
Thanks in advance for all your help
Pierre
--------------------------
Hi,
Someone said that you cant use multiple database connection. Havent
done a lot of simultaneous connection recently but you could just
detach the connection without closing it then reattach it when you
want to continue working on your transaction.
Heres how to do transaction that span more than one database.
At the end of each database processing you flush your SQL statements
to the database. If both pass correctly then you commit on both
database transaction to officialize the transaction. I think you can
have SimpleORM do all this automatically but have never tried it.
Sylvain
-----------------------
You encapuslate both transactions in an outer transaction.
All participants vote.
If participant vote = 100% operationally successful, then the outer
object authorizes each participant to do a commit.
-Lane
Pierre Awaragi wrote:
Hi All,
I just started using SimpleORM library after an extensive search for the
best O/R philosophy. Congrats to Anthony for this wonderfull tool.
I am trying to slowly incorporate simple orm into my already existing
application and slowly convert my in-house OR classes. My application
uses multiple datasources connected to multiple databases (all running
on mysql 4.0.x server). I have a data source that connects to actual
data entry records and another source to logs of these entries.
Insert into record
create log of record insertion.
My question is how can I insure that these two operations using two
different database connections are encapsulated within the same
transaction? I cannot use two commits as if the first one success but
the second, I cannot rollback the first after it's been already
committed.
PS, the reason for splitting these information is that multiple servers
can write to the same record database and each to its own log database.
Access to the records is controlled by the logs so it's an all or
nothing operation.
Thanks for all your help,
Pierre
To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
--
Lane Sharman
Just Do IT, Better.
858-755-2868
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/5cFolB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
SimpleORM-unsubscribe <at> yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/