001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ContainerTransactionDefault.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.base.transaction;
025:
026: import javax.naming.NamingException;
027:
028: import org.ow2.easybeans.tests.common.exception.TransactionException;
029:
030: /**
031: * Inserts the table test in two databases without using annotations that
032: * specify the transaction attribute. By default, the transaction attribute is
033: * REQUIRED in all methods.
034: * @author Gisele Pinheiro Souza
035: * @author Eduardo Studzinski Estima de Castro
036: */
037: public class ContainerTransactionDefault extends ContainerTransaction {
038:
039: /**
040: * Inserts the table test in both database using required transaction.
041: * @param db1 the first databse name.
042: * @param db2 the second database name.
043: * @throws Exception if an error occurs.
044: */
045: @Override
046: public void insertCorrectTableInBothDB(final String db1,
047: final String db2) throws Exception {
048: super .insertCorrectTableInBothDB(db1, db2);
049: }
050:
051: /**
052: * Inserts the table test in the first database and makes an incorrect query in the second database.
053: * This method is using required transaction, so this must to force a roll back.
054: * @param db1 the first databse name.
055: * @param db2 the second database name.
056: * @throws Exception if an error occurs.
057: */
058: @Override
059: public void insertCorrectFirstErrorSecond(final String db1,
060: final String db2) throws Exception {
061: super .insertCorrectFirstErrorSecond(db1, db2);
062: }
063:
064: /**
065: * Calls the method EJBContext.getRollbackOnly().
066: * @return true if the rollback only is set, false otherwise.
067: * @throws TransactionException if an IllegalStateException occurs.
068: */
069: @Override
070: public boolean getRollbackOnly() throws TransactionException {
071: return super .getRollbackOnly();
072: }
073:
074: /**
075: * Calls the method SessionContext.setRollbackOnly().
076: * @param dbName1 the first database where the table should be inserted.
077: * @param dbName2 the second database where the table should be inserted.
078: * @throws Exception if an error occurs.
079: */
080: @Override
081: public void setRollbackOnly(final String dbName1,
082: final String dbName2) throws Exception, NamingException {
083: super .setRollbackOnly(dbName1, dbName2);
084: }
085:
086: /**
087: * @see org.ow2.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
088: * @param db1 the name of the first database.
089: * @param db2 the name of the second database.
090: * @throws Exception if an error during the execution occurs.
091: */
092: @Override
093: public void insertTablesUsingAuxBeanReq(final String db1,
094: final String db2) throws Exception {
095: super .insertTablesUsingAuxBeanReq(db1, db2);
096: }
097:
098: /**
099: * @see org.ow2.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
100: * @param db1 the name of the first database.
101: * @param db2 the name of the second database.
102: * @throws Exception if an error during the execution occurs.
103: */
104: @Override
105: public void insertTablesUsingAuxBeanNotSup(final String db1,
106: final String db2) throws Exception {
107: super .insertTablesUsingAuxBeanNotSup(db1, db2);
108: }
109:
110: /**
111: * @see org.ow2.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
112: * @throws Exception if an error occurs.
113: */
114: @Override
115: public void getUserTransactionWithLookup() throws Exception {
116: super .getUserTransactionWithLookup();
117: }
118:
119: /**
120: * @see org.ow2.easybeans.tests.common.ejbs.base.transaction.ContainerTransaction
121: * @throws Exception if an error occurs.
122: */
123: @Override
124: public void getUserTransactionWithEJBContext() throws Exception {
125: super.getUserTransactionWithEJBContext();
126: }
127: }
|