Re: Transaction Set clean does not actually clean

Jeff Johnson <[email protected]> Fri, 7 Dec 2007 15:12:31 -0500
Newsgroups gmane.linux.redhat.rpm.python
Message-ID <[email protected]>
On Dec 7, 2007, at 2:47 PM, Mitko Haralanov wrote:

> I am having a issue with the clean method of the TransactionSet class
> (ts). It doesn't actually seem to clean the transaction set.
>
> I have written a wrapper class around the TransactionSet class to hide
> some of the lower level stuff and be a bit more convenient. In my
> class, I have methods which open and close the RPM database, so other
> users/processes can get the database lock. What is important to  
> note is
> that, when closing the database, I don't delete the TransactionSet
> instance - I just call the closeDB() method.
>

Calling closeDB() (or doing any operation on a rpmdb) explicitly is not
recommended. Delete the transaction set and create a new transaction
instead. The reason is that there are global aspects to concurrent
access of an rpmdb that few application programs are prepared to
implement properly.

> Every time, the database is closed, I also call TransactionSet.clean 
> (),
> however, in subsequent calls into the TransactionSet instance, I see
> that there are left over transactions from previous calls.
>
> I would appreciate it if anyone could tell me how to properly clean  
> the
> TransactionSet?
>

Delete the transaction set and create a new one.

73 de Jeff