Source Code Cross Referenced for Transaction.java in  » Database-ORM » hibernate » org » hibernate » 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 ORM » hibernate » org.hibernate 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$Id: Transaction.java 9595 2006-03-10 18:14:21Z steve.ebersole@jboss.com $
002:        package org.hibernate;
003:
004:        import javax.transaction.Synchronization;
005:
006:        /**
007:         * Allows the application to define units of work, while
008:         * maintaining abstraction from the underlying transaction
009:         * implementation (eg. JTA, JDBC).<br>
010:         * <br>
011:         * A transaction is associated with a <tt>Session</tt> and is
012:         * usually instantiated by a call to <tt>Session.beginTransaction()</tt>.
013:         * A single session might span multiple transactions since
014:         * the notion of a session (a conversation between the application
015:         * and the datastore) is of coarser granularity than the notion of
016:         * a transaction. However, it is intended that there be at most one
017:         * uncommitted <tt>Transaction</tt> associated with a particular
018:         * <tt>Session</tt> at any time.<br>
019:         * <br>
020:         * Implementors are not intended to be threadsafe.
021:         *
022:         * @see Session#beginTransaction()
023:         * @see org.hibernate.transaction.TransactionFactory
024:         * @author Anton van Straaten
025:         */
026:        public interface Transaction {
027:
028:            /**
029:             * Begin a new transaction.
030:             */
031:            public void begin() throws HibernateException;
032:
033:            /**
034:             * Flush the associated <tt>Session</tt> and end the unit of work (unless
035:             * we are in {@link FlushMode#NEVER}.
036:             * </p>
037:             * This method will commit the underlying transaction if and only
038:             * if the underlying transaction was initiated by this object.
039:             *
040:             * @throws HibernateException
041:             */
042:            public void commit() throws HibernateException;
043:
044:            /**
045:             * Force the underlying transaction to roll back.
046:             *
047:             * @throws HibernateException
048:             */
049:            public void rollback() throws HibernateException;
050:
051:            /**
052:             * Was this transaction rolled back or set to rollback only?
053:             * <p/>
054:             * This only accounts for actions initiated from this local transaction.
055:             * If, for example, the underlying transaction is forced to rollback via
056:             * some other means, this method still reports false because the rollback
057:             * was not initiated from here.
058:             *
059:             * @return boolean True if the transaction was rolled back via this
060:             * local transaction; false otherwise.
061:             * @throws HibernateException
062:             */
063:            public boolean wasRolledBack() throws HibernateException;
064:
065:            /**
066:             * Check if this transaction was successfully committed.
067:             * <p/>
068:             * This method could return <tt>false</tt> even after successful invocation
069:             * of {@link #commit}.  As an example, JTA based strategies no-op on
070:             * {@link #commit} calls if they did not start the transaction; in that case,
071:             * they also report {@link #wasCommitted} as false.
072:             *
073:             * @return boolean True if the transaction was (unequivocally) committed
074:             * via this local transaction; false otherwise.
075:             * @throws HibernateException
076:             */
077:            public boolean wasCommitted() throws HibernateException;
078:
079:            /**
080:             * Is this transaction still active?
081:             * <p/>
082:             * Again, this only returns information in relation to the
083:             * local transaction, not the actual underlying transaction.
084:             *
085:             * @return boolean Treu if this local transaction is still active.
086:             */
087:            public boolean isActive() throws HibernateException;
088:
089:            /**
090:             * Register a user synchronization callback for this transaction.
091:             *
092:             * @param synchronization The Synchronization callback to register.
093:             * @throws HibernateException
094:             */
095:            public void registerSynchronization(Synchronization synchronization)
096:                    throws HibernateException;
097:
098:            /**
099:             * Set the transaction timeout for any transaction started by
100:             * a subsequent call to <tt>begin()</tt> on this instance.
101:             *
102:             * @param seconds The number of seconds before a timeout.
103:             */
104:            public void setTimeout(int seconds);
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.