[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error: ExternalTransaction in a LocalDatabase



My own solution to this is:

- in ExternalDatabase, add method:

   /** Returns true if a thread has already joined the specified
transaction. */
    protected final boolean txHasThread(AbstractTransaction tx)
    { return (txTable.keyForElement(tx) != null); }

- in LocalDatabase, change method to:

  public void joinTX( AbstractTransaction tx ) throws TransactionExc {
	if (txHasThread(tx))
	    // currently the client side threads are used for server internal
work;
	    // that is, DbLocalClient just calls the appropriate server method;
but
	    // the server can handle only one thread per transaction, therefore
	    // jointTX for local connections is not allowed -> one
(Command)Thread per
	    // DbLocalClient
	    throw new RuntimeException( "joinTX()" );
	else
	    super.joinTX(tx);
    }

An other possibility may be overwriting beginTX in LocalDatabase.

What do you think?

Michael Keuchen