Java Doc for ExternalTransaction.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ozoneDB.AbstractTransaction
      org.ozoneDB.ExternalTransaction

ExternalTransaction
final public class ExternalTransaction extends AbstractTransaction implements Referenceable(Code)
ExternalTransaction allows an application to explicitly manage transaction boundaries.

When programming ozone applications explicite transaction demarcation is needed under rare circumstances only (for example: processing of binary large objects - BLOBs). In fact, in most cases explicite transactions are not really needed while implicite transactions are cleaner and faster. So, every time you are going to use explicite transactions, you should ask yourself if an implicite transaction is maybe a better choice.

In case of a deadlock the ordinary behaviour of ozone is to abort one of the locked transactions and restart until all transactions are successfully commited. This is not possible when explicite transactions are used! In case of deadlock an exceptions is thrown and the client has to decide what to do.

Note: If an operation that runs under control of this transaction fails, the transaction is set to rollback only.
author:
   SMB
version:
   $Revision: 1.1 $Date: 2001/12/18 10:31:30 $



Field Summary
final public static  intSTATUS_ACTIVE
     Status of a transaction: transaction has been started.
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_ROLLEDBACK
     Status of a transaction: transaction has been aborted.
final public static  intSTATUS_ROLLINGBACK
     Status of a transaction: transaction is about to abort.
protected  booleanrollbackOnly
    

Constructor Summary
public  ExternalTransaction(ExternalDatabase _database)
    

Method Summary
public  voidbegin()
     Start work on behalf of this transaction and associate it with the current thread.
public  voidcheckpoint()
     Checkpoint this transaction.
public  voidcommit()
     Complete this transaction.
public  voidcommit(boolean onePhase)
     Complete this transaction.
public static  ExternalTransactiongetInstance()
    
public  ObjectgetObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env)
    
public  ReferencegetReference()
     Retrieves the JNDI Reference of this object.
public  intgetStatus()
     Obtain the status of the transaction associated with the current thread.
public  voidjoin()
     Attach the caller's thread to this transaction and detach the thread from any former Transaction the thread may have been associated with.
public  voidleave()
     Detach the caller's thread from this Transaction, but do not attach the thread to another Transaction.
public  voidprepare()
     Prepares this transaction.
public  voidrollback()
     Rollback the transaction associated with the current thread.
public synchronized  voidsetRollbackOnly()
     Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
public  voidsetTransactionTimeout(int seconds)
     Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.
Parameters:
  seconds - The value of the timeout in seconds.

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



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_ROLLEDBACK
final public static int STATUS_ROLLEDBACK(Code)
Status of a transaction: transaction has been aborted.



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



rollbackOnly
protected boolean rollbackOnly(Code)




Constructor Detail
ExternalTransaction
public ExternalTransaction(ExternalDatabase _database)(Code)




Method Detail
begin
public void begin() throws TransactionExc, IOException(Code)
Start work on behalf of this transaction and associate it with the current thread.
throws:
  TransactionExc - If the thread is already associated with atransaction.
throws:
  IOException - If the server is not reachable.



checkpoint
public void checkpoint() throws TransactionExc, IOException(Code)
Checkpoint this transaction. This method can also be called by a non-joined thread.



commit
public void commit() throws TransactionExc, IOException(Code)
Complete this transaction. When this method completes, the thread becomes associated with no transaction. This method can be called by a non-joined thread.



commit
public void commit(boolean onePhase) throws TransactionExc, IOException(Code)
Complete this transaction. When this method completes, the thread becomes associated with no transaction. This method is intended to be used by transactional applications that need two-phase commit.



getInstance
public static ExternalTransaction getInstance()(Code)



getObjectInstance
public Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env)(Code)



getReference
public Reference getReference() throws NamingException(Code)
Retrieves the JNDI Reference of this object. The non-null Reference of this object.



getStatus
public int getStatus() throws TransactionExc, IOException(Code)
Obtain the status of the transaction associated with the current thread.



join
public void join() throws TransactionExc, IOException(Code)
Attach the caller's thread to this transaction and detach the thread from any former Transaction the thread may have been associated with.



leave
public void leave() throws TransactionExc, IOException(Code)
Detach the caller's thread from this Transaction, but do not attach the thread to another Transaction.



prepare
public void prepare() throws TransactionExc, IOException(Code)
Prepares this transaction. This method is intended to be used by transactional applications that need two-phase commit.



rollback
public void rollback() throws TransactionExc, IOException(Code)
Rollback the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction. Calling this method when the transaction is not opened doe not throw an exception.

This method can be called by any threads.




setRollbackOnly
public synchronized void setRollbackOnly() throws TransactionExc, IOException(Code)
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.



setTransactionTimeout
public void setTransactionTimeout(int seconds) throws TransactionExc, IOException(Code)
Modify the value of the timeout value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.
Parameters:
  seconds - The value of the timeout in seconds. If the value is zero,the transaction service restores the default value



Fields inherited from org.ozoneDB.AbstractTransaction
protected DbClient connection(Code)(Java Doc)
protected ExternalDatabase database(Code)(Java Doc)


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.