[Mulgara-dev] transaction implementation

Life is hard, and then you die ronald at innovation.ch
Tue Jul 1 16:47:53 UTC 2008


On Tue, Jul 01, 2008 at 08:12:06AM -0700, Life is hard, and then you die wrote:
> On Wed, Jul 02, 2008 at 12:57:12AM +1000, Andrae Muys wrote:
> > 
> > On 01/07/2008, at 6:41 PM, Life is hard, and then you die wrote:
> > > First of all, the MulgaraInternalTransactionFactory and
> > > MulgaraExternalTransactionFactory are scoped per Database (i.e. per
> > > SessionFactory); however, all methods require a Session parameter, and
> > > indeed all data managed by these factories is on a per-session basis
> > > with no cross-session operations. Wouldn't it therefore be better to
> > > make instances of these session-scoped in the first place? That way
> > > not only are the data structures simplified, but we can get rid of the
> > > mutex and thereby reduce the potential for deadlocks. I.e. is there
> > > any future reason why these instances should stay session-factory
> > > scoped? (Btw., I've make this change in my local repository and
> > > verified it works and have not overlooked anything regarding the
> > > current state of things).
> > 
> > Certainly we could track the 'current-thread' with a simple  
> > synchronized block.
> 
> This is already being done, but it's done in the
> MulgaraInternalTransaction, not the factory.

It just occurred to me that you may have meant 'current write
transaction' instead, which indeed is managed by the factory and which
also needs to be protected by a simple synchronized block because the
timeout thread accesses it too.


  Cheers,

  Ronald




More information about the Mulgara-dev mailing list