KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > base > transaction > ContainerTransactionDefault


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ContainerTransactionDefault.java 808 2006-07-03 13:58:29Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.base.transaction;
26
27 import javax.naming.NamingException JavaDoc;
28
29 import org.objectweb.easybeans.tests.common.exception.TransactionException;
30
31 /**
32  * Inserts the table test in two databases without using annotations that
33  * specify the transaction attribute. By default, the transaction attribute is
34  * REQUIRED in all methods.
35  * @author Gisele Pinheiro Souza
36  * @author Eduardo Studzinski Estima de Castro
37  */

38 public class ContainerTransactionDefault extends ContainerTransaction {
39
40     /**
41      * Inserts the table test in both database using required transaction.
42      * @param db1 the first databse name.
43      * @param db2 the second database name.
44      * @throws Exception if an error occurs.
45      */

46     @Override JavaDoc
47     public void insertCorrectTableInBothDB(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
48         super.insertCorrectTableInBothDB(db1, db2);
49     }
50
51     /**
52      * Inserts the table test in the first database and makes an incorrect query in the second database.
53      * This method is using required transaction, so this must to force a roll back.
54      * @param db1 the first databse name.
55      * @param db2 the second database name.
56      * @throws Exception if an error occurs.
57      */

58     @Override JavaDoc
59     public void insertCorrectFirstErrorSecond(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
60         super.insertCorrectFirstErrorSecond(db1, db2);
61     }
62
63     /**
64      * Calls the method EJBContext.getRollbackOnly().
65      * @return true if the rollback only is set, false otherwise.
66      * @throws TransactionException if an IllegalStateException occurs.
67      */

68     @Override JavaDoc
69     public boolean getRollbackOnly() throws TransactionException {
70         return super.getRollbackOnly();
71     }
72
73     /**
74      * Calls the method SessionContext.setRollbackOnly().
75      * @param dbName1 the first database where the table should be inserted.
76      * @param dbName2 the second database where the table should be inserted.
77      * @throws Exception if an error occurs.
78      */

79     @Override JavaDoc
80     public void setRollbackOnly(final String JavaDoc dbName1, final String JavaDoc dbName2) throws Exception JavaDoc,
81             NamingException JavaDoc {
82      super.setRollbackOnly(dbName1, dbName2);
83     }
84
85     /**
86      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
87      * @param db1 the name of the first database.
88      * @param db2 the name of the second database.
89      * @throws Exception if an error during the execution occurs.
90      */

91     @Override JavaDoc
92     public void insertTablesUsingAuxBeanReq(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
93         super.insertTablesUsingAuxBeanReq(db1, db2);
94     }
95
96     /**
97      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
98      * @param db1 the name of the first database.
99      * @param db2 the name of the second database.
100      * @throws Exception if an error during the execution occurs.
101      */

102     @Override JavaDoc
103     public void insertTablesUsingAuxBeanNotSup(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
104        super.insertTablesUsingAuxBeanNotSup(db1, db2);
105     }
106
107     /**
108      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
109      * @throws Exception if an error occurs.
110      */

111     @Override JavaDoc
112     public void getUserTransactionWithLookup() throws Exception JavaDoc {
113         super.getUserTransactionWithLookup();
114     }
115
116     /**
117      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
118      * @throws Exception if an error occurs.
119      */

120     @Override JavaDoc
121     public void getUserTransactionWithEJBContext() throws Exception JavaDoc {
122         super.getUserTransactionWithEJBContext();
123     }
124 }
125
Popular Tags