KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > ejb > cmp3 > transaction > EntityTransactionImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.ejb.cmp3.transaction;
23
24 /**
25  * JDK 1.5 version of the EntityTransaction. Differs from base version only in that
26  * it takes a JDK 1.5 version of the EntityTransactionWrapper.
27  *
28  * @see oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl
29  */

30 public class EntityTransactionImpl
31     extends oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl
32     implements javax.persistence.EntityTransaction
33 {
34     public EntityTransactionImpl(EntityTransactionWrapper wrapper) {
35         super(wrapper);
36     }
37     /**
38      * Commit the current transaction, writing any un-flushed changes to the database.
39      * This can only be invoked if {@link #isActive()} returns <code>true</code>.
40      * @throws IllegalStateException if isActive() is false.
41      * @throws PersistenceException if the commit fails.
42      */

43     public void commit(){
44       try{
45         super.commit();
46       }catch (oracle.toplink.essentials.exceptions.TopLinkException tlException ) {
47         //put here to avoid EJB3.0 dependencies in TopLink for jdk 1.4
48
throw new javax.persistence.RollbackException(tlException);
49       }
50     }
51 }
52
Popular Tags