KickJava   Java API By Example, From Geeks To Geeks.

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


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: ContainerTransactionNever.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.ejb.TransactionAttribute JavaDoc;
28 import javax.ejb.TransactionAttributeType JavaDoc;
29 import javax.ejb.TransactionManagement JavaDoc;
30 import javax.ejb.TransactionManagementType JavaDoc;
31 import javax.naming.NamingException JavaDoc;
32
33 import org.objectweb.easybeans.tests.common.exception.TransactionException;
34
35 /**
36  * Inserts the table test in two databases using the annotation @TransactionAttribute(NEVER) in all methods.
37  * @author Gisele Pinheiro Souza
38  * @author Eduardo Studzinski Estima de Castro
39  *
40  */

41 @TransactionManagement JavaDoc(value = TransactionManagementType.CONTAINER)
42 public class ContainerTransactionNever extends ContainerTransaction {
43
44     /**
45      * Inserts the table test in both database using the never transaction attribute.
46      * @param db1 the name of the first database.
47      * @param db2 the name of the second database.
48      * @throws Exception if an error occurs.
49      */

50     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
51     @Override JavaDoc
52     public void insertCorrectTableInBothDB(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
53         super.insertCorrectTableInBothDB(db1, db2);
54     }
55
56     /**
57      * Inserts the table test in the first database and makes an incorrect query in the second database.
58      * @param db1 the name of the first database.
59      * @param db2 the name of the second database.
60      * @throws Exception if an error occurs.
61      */

62     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
63     @Override JavaDoc
64     public void insertCorrectFirstErrorSecond(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
65         super.insertCorrectFirstErrorSecond(db1, db2);
66     }
67
68     /**
69      * Calls the method EJBContext.getRollbackOnly().
70      * @return true if the rollback only is set, false otherwise.
71      * @throws TransactionException if an IllegalStateException occurs.
72      */

73     @Override JavaDoc
74     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
75     public boolean getRollbackOnly() throws TransactionException {
76         return super.getRollbackOnly();
77     }
78
79     /**
80      * Calls the method SessionContext.setRollbackOnly().
81      * @param dbName1 the first database where the table should be inserted.
82      * @param dbName2 the second database where the table should be inserted.
83      * @throws Exception if an error occurs.
84      */

85     @Override JavaDoc
86     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
87     public void setRollbackOnly(final String JavaDoc dbName1, final String JavaDoc dbName2) throws Exception JavaDoc, NamingException JavaDoc {
88         super.setRollbackOnly(dbName1, dbName2);
89     }
90
91     /**
92      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
93      * @param db1 the name of the first database.
94      * @param db2 the name of the second database.
95      * @throws Exception if an error during the execution occurs.
96      */

97     @Override JavaDoc
98     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
99     public void insertTablesUsingAuxBeanReq(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
100         super.insertTablesUsingAuxBeanReq(db1, db2);
101     }
102
103     /**
104      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
105      * @param db1 the name of the first database.
106      * @param db2 the name of the second database.
107      * @throws Exception if an error during the execution occurs.
108      */

109     @Override JavaDoc
110     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
111     public void insertTablesUsingAuxBeanNotSup(final String JavaDoc db1, final String JavaDoc db2) throws Exception JavaDoc {
112         super.insertTablesUsingAuxBeanNotSup(db1, db2);
113     }
114
115     /**
116      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
117      *
118      */

119     @Override JavaDoc
120     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
121     public void getUserTransactionWithLookup() throws Exception JavaDoc {
122         super.getUserTransactionWithLookup();
123     }
124
125     /**
126      * @see org.objectweb.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
127      * @throws Exception if an error occurs.
128      */

129     @Override JavaDoc
130     @TransactionAttribute JavaDoc(value = TransactionAttributeType.NEVER)
131     public void getUserTransactionWithEJBContext() throws Exception JavaDoc {
132         super.getUserTransactionWithEJBContext();
133     }
134
135 }
136
Popular Tags