On 27 Jun 2007 at 9:45, John Siracusa wrote:

> > And if it works in principle do I have to stuff the $dbh manually into every
> > RDBO object or does it "just work" because Apache::DBI takes care that RDBO
> > gets the right (perhaps reused) handle even if RDBO always requests a fresh
> > one?
> 
> If you use the default init_db() implementation (which just returns
> Rose::DB->new), then under Apache::DBI, all Rose::DB::Object objects
> will have their own Rose::DB object, but every Rose::DB object will
> share a single DBI $dbh (and therefore a single database connaction).
> This is the setup that I use.
> 
> More discussion in this thread:
> 
> http://www.mail-archive.com/rose-db-object@lists.sourceforge.net/msg01803.html

Perhaps I am too stupid to grasp it but even after reading most of this thread 
I still don't 
understand why this is safe (I would like it to be, of course) Think of this 
scenario (all with a 
mod_perl app with many users):
User one submits a form that does two loosely related write operations (no RDBO 
sub-objects) 
after the first $obj->save the request of another user is finished and does a 
commit.
Now -- because both share the same $dbh/connection due to Apache::DBI -- the 
save of user one 
is also commited and if something goes wrong in the second write operation data 
integrity is lost.

What did I miss?

Michael


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to