Re: [CDBI] Committing on delete

Nick Peters <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Michael Peters wrote:
> Nick Peters wrote:
>   
>> Hi,  I'm sorry about having to ask such a basic question.
>>
>> I'm trying to add transactions to my database.  I have been able to
>> commit insertions and edit records but I really can't work out how to
>> commit deletions.
>>
>> Trying update or dbi_commit  on the object I have just deleted gives me
>> the error "Can't locate object method "x" via package
>> "Class::DBI::Object::Has::Been::Deleted" which I can understand as I'm
>> trying to call it on an object I have just deleted but I can't work out
>> how I am meant to commit the change.
>>     
>
> dbi_commit() is actually a class method, not an object method. It works
> when you call it on an object, but that's just a side-effect. In fact,
> it's confusing to call it as an object method since it doesn't just
> commit that object, but everything since your last commit.
>
> I would recommend that you always call it like so:
>   MyApp::DB->dbi_commit();
>
>   


Thankyou Michael and Matt,

That works now. It was totally a misunderstanding on my part as to what  
dbi_commit() was actually doing.

Nick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.