Re: Committing rolling back many objects at once?

[prev] [thread] [next] [Date index for 2005/01/20]

From: Peter Speltz
Subject: Re: Committing rolling back many objects at once?
Date: 18:15 on 20 Jan 2005
--- Perrin Harkins <perrin@xxxx.xxx> wrote:

> On Thu, 2005-01-20 at 10:03 -0800, Peter Speltz wrote:
> > Can you create many different objects then commit or roll back all or any
> of
> > them?
> 
> No, you can only rollback or commit everything you did on a certain
> database connection.  Typically that means you affect all of your
> objects.  I always call dbi_commit as a class method on my base class to
> remind myself of this.
> 


That's a quick response :). thanks.  Ok. so I CAN create many and commit many
at once or rollback many at once but just not individually. very cool. So to
update my example : this should work:

my $person = Person->create( ...);
my $emp    = Employee->create(...);
if ($error) {
   MyModelBase->dbi_rollback;
}
else {
   MyModelBase->dbi_commit;
}

That's very cool if that works. thanks

=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Committing rolling back many objects at once?
Peter Speltz 18:03 on 20 Jan 2005

Re: Committing rolling back many objects at once?
Perrin Harkins 18:06 on 20 Jan 2005

Re: Committing rolling back many objects at once?
Peter Speltz 18:15 on 20 Jan 2005

Re: Committing rolling back many objects at once?
Perrin Harkins 04:03 on 21 Jan 2005

RE: Committing rolling back many objects at once?
Addison, Mark 15:22 on 26 Jan 2005

RE: Committing rolling back many objects at once?
Peter Speltz 17:43 on 26 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52