KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > AbstractLock


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: AbstractLock.java,v 1.4 2002/09/18 06:54:14 per_nyfelt Exp $
8

9 package org.ozoneDB.core;
10
11 import org.ozoneDB.util.LogWriter;
12
13
14 /**
15  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
16  * @version $Revision: 1.4 $Date: 2002/09/18 06:54:14 $
17  */

18 public abstract class AbstractLock implements Lock {
19
20
21     public void checkDeadlock( Transaction ta ) throws TransactionError {
22         if (ta.isDeadlocked()/*ta.env.transactionManager.isDeadlockTA( ta )*/) {
23             if (false) {
24                 ta.env.logWriter.newEntry( this, ta + " deadlock detected...", LogWriter.DEBUG );
25             }
26             throw new TransactionError( "Deadlock detected.", TransactionError.DEADLOCK );
27         }
28     }
29
30 }
31
Popular Tags