Java Doc for Transaction.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » Ozone 1.1 » org.ozoneDB.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ozoneDB.core.Transaction

Transaction
final public class Transaction implements Locker(Code)
This class represents an internal transaction.

Most methods of this class are synchronized. In fact, this is not strictly needed because a transaction is invoked by one thread (associated with this transaction) only.

All public methods are wrapped into try/catch statements to convert thrown exception into OzoneInternalExc. So the client gets OzoneRemoteExc, if an object could not be found or something; OzoneInternalExc, if there was a critical internal error; any other exceptions were thrown by the user code.
author:
   SMB
author:
   Medium.net
version:
   $Revision: 1.4 $Date: 2002/07/26 12:29:22 $



Field Summary
final public static  intHASHTABLE_INIT_SIZE
    
final public static  intSTATUS_ABORTED
     Status of a transaction: transaction has been aborted.
final public static  intSTATUS_ABORTING
     Status of a transaction: transaction is about to abort.
final public static  intSTATUS_COMMITED
     Status of a transaction: transaction has been successfully committed.
final public static  intSTATUS_COMMITING
     Status of a transaction: transaction is about to commit.
final public static  intSTATUS_NONE
     Status of a transaction: transaction is not active.
final public static  intSTATUS_PREPARED
     Status of a transaction: transaction has been successfully prepared.
final public static  intSTATUS_PREPARING
     Status of a transaction: transaction is about to prepare.
final public static  intSTATUS_STARTED
     Status of a transaction: transaction has been started.
protected  intacquireCount
    
protected  ObjectIDblocker
     The ID of the object (container) that blocks this transaction.
protected  SimpleArrayListcallStack
     The list of ObjectContainer s which are called by this transactions but where the call is not completed.
protected  intcommandCount
    
protected  longdeadlockWaitTimeMaximum
     The maximum time (in milliseconds) to wait after a deadlock.
final protected static  longdeadlockWaitTimeMaximumMaximum
     The maximum deadlockWaitTimeMaximum can have.
final protected static  longdeadlockWaitTimeMaximumMinimum
     The minimum deadlockWaitTimeMaximum can have.
protected  booleandeadlocked
    
protected transient  Envenv
     The environment of this object.
protected  intmaxLockLevel
    
protected  Userowner
    
protected  StringownerName
    
protected  booleanrollbackOnly
    
protected  booleansleeping
    
protected  longstartTime
    
protected  intstatus
    
protected  booleanstopped
    
protected  TransactionIDtaID
    

Constructor Summary
public  Transaction(Env _env, User _owner)
     Construct a new transaction.
public  Transaction(TransactionID _taID)
     Construct a new transaction.

Method Summary
public synchronized  voidabort(DbCommand command)
     Once this method is called it MUST cleanup the entire transaction stuff without exception.
protected  ObjectContaineracquireContainer(ObjectContainer container, int lockLevel)
    
public  ObjectContaineracquireObjectAndPin(ObjectID id, int lockLevel)
     Set a lock on the container specified by the given object ID and join the container to this transaction. If a container is returned, it is pinned.
public  LockableblockedByAndPin()
    
public synchronized  voidcommit()
     Commit this transaction.
public  ObjectContainercopyObjectAndPin(ObjectID id)
    
public  ObjectContainercreateObjectAndPin(String className, int access, String name, String sig, Object[] args, ObjectID id)
     Create a new database object.
public  voiddeleteObject(ObjectID id)
    
public  booleanequals(Object obj)
    
public  voidfinalize()
    
public  SimpleArrayListgetCallStack()
    
public  ObjectgetData()
    
protected  longgetDeadlockWaitTimeMaximum()
    
public  TransactionManagergetManager()
    
protected  longincreaseDeadlockWaitTimeMaximum()
    
public  ObjectinvokeObject(ObjectID id, String methodName, String sig, Object[] args, int lockLevel)
    
public  ObjectinvokeObject(ObjectID id, int methodIndex, Object[] args, int lockLevel)
    
public  booleanisBlocked()
     Returns wether this locker is blocked.
public  booleanisDeadlocked()
    
protected  booleanisSleeping()
    
public  intmaxLockLevel()
    
public  voidnameObject(ObjectID id, String name)
    
public  OzoneProxyobjectForID(ObjectID id)
    
public  OzoneProxyobjectForName(String name)
    
public  Userowner()
    
public  booleanperformCommand(DbCommand command)
    
public synchronized  voidprepareCommit()
    
public  voidreleaseObjectAndUnpin(ObjectContainer objectContainer)
     The corresponding method to Transaction.acquireObjectAndPin .
public  voidreset()
    
protected  voidsetData(Object to)
    
protected  voidsetDeadlockWaitTimeMaximum(long to)
    
public  voidsetDeadlocked(boolean to)
    
public  voidsleep(long millis)
    
public  intstatus()
    
public synchronized  voidstop()
    
public  TransactionIDtaID()
    
public  StringtoString()
    

Field Detail
HASHTABLE_INIT_SIZE
final public static int HASHTABLE_INIT_SIZE(Code)



STATUS_ABORTED
final public static int STATUS_ABORTED(Code)
Status of a transaction: transaction has been aborted.



STATUS_ABORTING
final public static int STATUS_ABORTING(Code)
Status of a transaction: transaction is about to abort.



STATUS_COMMITED
final public static int STATUS_COMMITED(Code)
Status of a transaction: transaction has been successfully committed.



STATUS_COMMITING
final public static int STATUS_COMMITING(Code)
Status of a transaction: transaction is about to commit.



STATUS_NONE
final public static int STATUS_NONE(Code)
Status of a transaction: transaction is not active.



STATUS_PREPARED
final public static int STATUS_PREPARED(Code)
Status of a transaction: transaction has been successfully prepared.



STATUS_PREPARING
final public static int STATUS_PREPARING(Code)
Status of a transaction: transaction is about to prepare.



STATUS_STARTED
final public static int STATUS_STARTED(Code)
Status of a transaction: transaction has been started.



acquireCount
protected int acquireCount(Code)



blocker
protected ObjectID blocker(Code)
The ID of the object (container) that blocks this transaction.



callStack
protected SimpleArrayList callStack(Code)
The list of ObjectContainer s which are called by this transactions but where the call is not completed. The last object called is represented by the ObjectContainer with the greatest index in the list.



commandCount
protected int commandCount(Code)



deadlockWaitTimeMaximum
protected long deadlockWaitTimeMaximum(Code)
The maximum time (in milliseconds) to wait after a deadlock.



deadlockWaitTimeMaximumMaximum
final protected static long deadlockWaitTimeMaximumMaximum(Code)
The maximum deadlockWaitTimeMaximum can have. (default: 30 minutes)



deadlockWaitTimeMaximumMinimum
final protected static long deadlockWaitTimeMaximumMinimum(Code)
The minimum deadlockWaitTimeMaximum can have. (default: 1 second)



deadlocked
protected boolean deadlocked(Code)
Are we deadlocked?



env
protected transient Env env(Code)
The environment of this object.



maxLockLevel
protected int maxLockLevel(Code)



owner
protected User owner(Code)



ownerName
protected String ownerName(Code)



rollbackOnly
protected boolean rollbackOnly(Code)



sleeping
protected boolean sleeping(Code)
Is this thread sleeping?



startTime
protected long startTime(Code)



status
protected int status(Code)



stopped
protected boolean stopped(Code)



taID
protected TransactionID taID(Code)




Constructor Detail
Transaction
public Transaction(Env _env, User _owner)(Code)
Construct a new transaction.
Parameters:
  _env - Environment of this transaction.
Parameters:
  _command - Command that will be performed by run().
Parameters:
  _owner - User that has started this transaction.



Transaction
public Transaction(TransactionID _taID)(Code)
Construct a new transaction. THIS TRANSACTION CAN BE USED FOR TESTING ONLY!




Method Detail
abort
public synchronized void abort(DbCommand command) throws IOException, ClassNotFoundException(Code)
Once this method is called it MUST cleanup the entire transaction stuff without exception. An exception signals an internal server error.

Note: This may be called after/from prepareCommit() !




acquireContainer
protected ObjectContainer acquireContainer(ObjectContainer container, int lockLevel) throws PermissionError, TransactionExc, TransactionError, IOException, ObjectNotFoundExc, ClassNotFoundException(Code)



acquireObjectAndPin
public ObjectContainer acquireObjectAndPin(ObjectID id, int lockLevel) throws ObjectNotFoundExc, IOException, ClassNotFoundException, TransactionExc, TransactionError(Code)
Set a lock on the container specified by the given object ID and join the container to this transaction. If a container is returned, it is pinned. Thus, it has to be unpinned by the caller.
Parameters:
  id - ObjectID of the container which we try to join to this transaction.
Parameters:
  lockLevel - The lock level we need on this object (container). The container for the specified id, if all was ok.
throws:
  ObjectNotFoundExc - If there is no such object.



blockedByAndPin
public Lockable blockedByAndPin()(Code)
Helper method to implement the Locker interface to support deadlock recognition via core.dr package



commit
public synchronized void commit() throws IOException, ClassNotFoundException(Code)
Commit this transaction. The transaction has to be in PREPARED state. Ones this method is called it MUST commit the entire transaction stuff without any exception.



copyObjectAndPin
public ObjectContainer copyObjectAndPin(ObjectID id) throws Exception(Code)



createObjectAndPin
public ObjectContainer createObjectAndPin(String className, int access, String name, String sig, Object[] args, ObjectID id) throws Exception, org.ozoneDB.ExceptionInOzoneObjectException(Code)
Create a new database object. If the className is null, an empty container is created.
Parameters:
  className -
Parameters:
  access -
Parameters:
  name -
Parameters:
  id - The ID of the new container or null.
exception:
  PermissionDeniedExc - If user in invalid, name is already inuse, target is not OzoneCompatible...



deleteObject
public void deleteObject(ObjectID id) throws ObjectNotFoundExc, IOException, ClassNotFoundException, TransactionExc, TransactionError, OzoneRemoteExc, OzoneInternalExc, ExceptionInOzoneObjectException(Code)



equals
public boolean equals(Object obj)(Code)



finalize
public void finalize() throws Throwable(Code)



getCallStack
public SimpleArrayList getCallStack()(Code)



getData
public Object getData()(Code)



getDeadlockWaitTimeMaximum
protected long getDeadlockWaitTimeMaximum()(Code)



getManager
public TransactionManager getManager()(Code)



increaseDeadlockWaitTimeMaximum
protected long increaseDeadlockWaitTimeMaximum()(Code)



invokeObject
public Object invokeObject(ObjectID id, String methodName, String sig, Object[] args, int lockLevel) throws Exception, org.ozoneDB.ExceptionInOzoneObjectException(Code)

Parameters:
  id -
Parameters:
  methodName -
Parameters:
  sig -
Parameters:
  lockLevel -



invokeObject
public Object invokeObject(ObjectID id, int methodIndex, Object[] args, int lockLevel) throws Exception, org.ozoneDB.ExceptionInOzoneObjectException(Code)



isBlocked
public boolean isBlocked()(Code)
Returns wether this locker is blocked.



isDeadlocked
public boolean isDeadlocked()(Code)



isSleeping
protected boolean isSleeping()(Code)



maxLockLevel
public int maxLockLevel()(Code)



nameObject
public void nameObject(ObjectID id, String name) throws Exception(Code)



objectForID
public OzoneProxy objectForID(ObjectID id) throws Exception(Code)



objectForName
public OzoneProxy objectForName(String name) throws Exception(Code)



owner
public User owner()(Code)



performCommand
public boolean performCommand(DbCommand command)(Code)



prepareCommit
public synchronized void prepareCommit() throws IOException, ClassNotFoundException(Code)



releaseObjectAndUnpin
public void releaseObjectAndUnpin(ObjectContainer objectContainer)(Code)
The corresponding method to Transaction.acquireObjectAndPin .
Currently, it just unpins the container.



reset
public void reset()(Code)



setData
protected void setData(Object to)(Code)



setDeadlockWaitTimeMaximum
protected void setDeadlockWaitTimeMaximum(long to)(Code)



setDeadlocked
public void setDeadlocked(boolean to)(Code)



sleep
public void sleep(long millis)(Code)



status
public int status()(Code)



stop
public synchronized void stop()(Code)



taID
public TransactionID taID()(Code)



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.