On Tue, Jun 07, 2011 at 02:27:52PM +0200, Jan Pazdziora wrote:
> 
> > I have no idea wether there's a way to ask the PostgreSQL/Oracle
> > session wether there is uncommitted work and/or a transaction open.
> > If there is a way to check this, we could just log detailed
> > warning-messages when a handler returns and rhnSQL has an open
> > transaction.
> 
> I'll try to check this, good point.

So, for PostgreSQL,

        
http://www.initd.org/psycopg/docs/connection.html#connection.get_transaction_status

says that

        get_transaction_status()

could be used.

For Oracle, select from v$transaction could probably be used.

But if we assume that all operations in the Python stack are done via
rhnSQL anyway, we should be able to track the state in the backend
code -- set a flag with each execute and unset it with each commit or
rollback.

We could even push the list of SQL commands done by the
prepares/executes to a stack to print out in the apacheHandler.
Could you check on your Spacewalk what statements are those dangling
in your situation (= what code path was used which lead to the idle
unfinished transaction)?

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to