Knut Wannheden wrote:
Aleksej,

On 1/24/06, Aleksej <[EMAIL PROTECTED]> wrote:
  
Lets say I have 2 threaded services, and one of them is must be created
before other AND discarded after it. One service must wrap other in
time. Idea is to create database connection service
and transaction service. Transaction service is wired with database
connection and at the end of thread it must commit or rollback all
changes. But because there is no order of discard specified, it is
possible, that Hivemind first will discard connection service and then
will try to discard transaction service, which will try to
commit/rollback using already closed connection. Any
ideas/recomendations/tricks  how to solve such problem?

    

Why don't you execute the commit / rollback before the service
instances are being discarded? Can't your transaction service have
explicit methods for commit and rollback?

--knut
  
Well, transaction service has such methods, problem is that it uses connection provided by
other service, which is bound to the same thread and which actually is responsible for
closing that connection. It is possible that connection will be closed before rollback or commit.
Maybe it is possible to inform Hivemind that one service depends on other and that service with
dependency from other must be discarded first? Or maybe Hivemind makes it automatically,
analizing services dependencies?

Reply via email to