[jboss-cvs] JBossAS SVN: r61736 - in branches/JBoss_3_2_8_SP1_CP: server/src/main/org/jboss/ejb and 9 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 27 10:07:55 EDT 2007
Author: darran.lofthouse at jboss.com
Date: 2007-03-27 10:07:55 -0400 (Tue, 27 Mar 2007)
New Revision: 61736
Added:
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml
Removed:
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml
branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml
Modified:
branches/JBoss_3_2_8_SP1_CP/
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/EntityEnterpriseContext.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/GlobalTxEntityMap.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java
branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/metadata/ConfigurationMetaData.java
branches/JBoss_3_2_8_SP1_CP/server/src/resources/org/jboss/metadata/jboss_3_2.dtd
branches/JBoss_3_2_8_SP1_CP/testsuite/imports/sections/cmp.xml
Log:
ASPATCH-173 - Port JBAS-979 flushCache Issue to JBoss 3.2.8.SP1
Property changes on: branches/JBoss_3_2_8_SP1_CP
___________________________________________________________________
Name: svn:ignore
+ thirdparty
.metadata
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/EntityEnterpriseContext.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/EntityEnterpriseContext.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/EntityEnterpriseContext.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -83,6 +83,9 @@
private NonReentrantLock methodLock = new NonReentrantLock();
+ /** used to force passivation after commit even if the co is not C */
+ private boolean passivateAfterCommit;
+
public EntityEnterpriseContext(Object instance, Container con)
throws RemoteException
{
@@ -113,6 +116,7 @@
ejbObject = null;
ejbLocalObject = null;
txAssociation = GlobalTxEntityMap.NONE;
+ passivateAfterCommit = false;
}
public void discard() throws RemoteException
@@ -215,6 +219,16 @@
return readOnly;
}
+ public boolean isPassivateAfterCommit()
+ {
+ return passivateAfterCommit;
+ }
+
+ public void setPassivateAfterCommit(boolean passivateAfterCommit)
+ {
+ this.passivateAfterCommit = passivateAfterCommit;
+ }
+
public String toString()
{
return getContainer().getBeanMetaData().getEjbName() + '#' + getId();
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/GlobalTxEntityMap.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/GlobalTxEntityMap.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/GlobalTxEntityMap.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -169,6 +169,33 @@
}
};
+ public static final TxAssociation PREVENT_SYNC = new TxAssociation()
+ {
+ public void scheduleSync(Transaction tx, EntityEnterpriseContext instance)
+ {
+ }
+
+ public void synchronize(Thread thread, Transaction tx, EntityEnterpriseContext instance) throws Exception
+ {
+ EntityContainer container = (EntityContainer)instance.getContainer();
+ if(container.getPersistenceManager().isStoreRequired(instance))
+ {
+ throw new EJBException("The instance of " +
+ container.getBeanMetaData().getEjbName() +
+ " with pk=" +
+ instance.getId() +
+ " was not stored to prevent potential inconsistency of data in the database:" +
+ " the instance was evicted from the cache during the transaction" +
+ " and the database was possibly updated by another process.");
+ }
+ }
+
+ public void invokeEjbStore(Thread thread, EntityEnterpriseContext instance) throws Exception
+ {
+ GlobalTxEntityMap.SYNC_SCHEDULED.invokeEjbStore(thread, instance);
+ }
+ };
+
/**
* sync all EntityEnterpriseContext that are involved (and changed)
* within a transaction.
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/AbstractInstanceCache.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -153,8 +153,23 @@
}
}
+ /**
+ * Tries to passivate the instance. If the instance is in use then the instance
+ * will be passivated later according to the container's commit option and max age.
+ */
protected void tryToPassivate(EnterpriseContext ctx)
{
+ tryToPassivate(ctx, false);
+ }
+
+ /**
+ * Tries to passivate the instance. If the instance is in use and passivateAfterCommit
+ * parameter is true then the instance will passivated after the transaction commits.
+ * Otherwise, the instance will be passivated later according to the container's
+ * commit option and max age.
+ */
+ protected void tryToPassivate(EnterpriseContext ctx, boolean passivateAfterCommit)
+ {
Object id = ctx.getId();
if (id == null) return;
BeanLock lock = getContainer().getLockManager().getLock(id);
@@ -175,7 +190,7 @@
lockedBean = lock2.attemptSync();
if( lockedBean == false )
{
- log.warn("Unable to passivate due to ctx lock, id="+id);
+ unableToPassivateDueToCtxLock(ctx, passivateAfterCommit);
return;
}
}
@@ -201,13 +216,13 @@
}
else
{
- log.warn("Unable to passivate due to ctx lock, id="+id);
-
// Touch the entry to make it MRU
synchronized (getCacheLock())
{
getCache().get(id);
}
+
+ unableToPassivateDueToCtxLock(ctx, passivateAfterCommit);
}
}
finally
@@ -218,7 +233,11 @@
}
}
- /* From InstanceCache interface */
+ /**
+ * Passivates and removes the instance from the cache.
+ * If the instance is in use then removal and passivation will be scheduled until
+ * after transaction ends
+ */
public void release(EnterpriseContext ctx)
{
if (ctx == null) throw new IllegalArgumentException("Can't release a null object");
@@ -226,13 +245,16 @@
// Here I remove the bean; call to remove(id) is wrong
// cause will remove also the cache lock that is needed
// by the passivation, that eventually will remove it.
+ /* the removal should only be done if the instance is not in use.
+ this is taken care of in tryToPassivate
Object id = getKey(ctx);
synchronized (getCacheLock())
{
if (getCache().peek(id) != null)
getCache().remove(id);
}
- tryToPassivate(ctx);
+ */
+ tryToPassivate(ctx, true);
}
/**
@@ -391,6 +413,11 @@
}
}
+ protected void unableToPassivateDueToCtxLock(EnterpriseContext ctx, boolean passivateAfterCommit)
+ {
+ log.warn("Unable to passivate due to ctx lock, id="+ctx.getId());
+ }
+
/**
* Returns the container for this cache.
*/
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntityInstanceCache.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -28,7 +28,9 @@
import org.jboss.ejb.EntityContainer;
import org.jboss.ejb.EnterpriseContext;
import org.jboss.ejb.EntityEnterpriseContext;
+import org.jboss.ejb.GlobalTxEntityMap;
import org.jboss.metadata.EntityMetaData;
+import org.jboss.metadata.ConfigurationMetaData;
import org.jboss.util.propertyeditor.PropertyEditors;
/**
@@ -154,6 +156,17 @@
// Protected -----------------------------------------------------
+ protected void unableToPassivateDueToCtxLock(EnterpriseContext ctx, boolean passivateAfterCommit)
+ {
+ EntityEnterpriseContext ectx = (EntityEnterpriseContext)ctx;
+ ectx.setPassivateAfterCommit(passivateAfterCommit);
+ ConfigurationMetaData config = m_container.getBeanMetaData().getContainerConfiguration();
+ if(!config.isStoreNotFlushed() && ectx.hasTxSynchronization())
+ {
+ ectx.setTxAssociation(GlobalTxEntityMap.PREVENT_SYNC);
+ }
+ }
+
// Private -------------------------------------------------------
// Inner classes -------------------------------------------------
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -398,7 +398,7 @@
// being used
if(ctx.getId() != null)
{
- container.getInstanceCache().release(ctx);
+ container.getInstanceCache().remove(ctx.getId());
}
}
catch(Exception e)
@@ -467,6 +467,10 @@
}
lock.sync();
+
+ int commitOption = ctx.isPassivateAfterCommit() ?
+ ConfigurationMetaData.C_COMMIT_OPTION : EntitySynchronizationInterceptor.this.commitOption;
+
// The context is no longer synchronized on the TX
ctx.hasTxSynchronization(false);
ctx.setTxAssociation(GlobalTxEntityMap.NONE);
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -264,6 +264,23 @@
// Y overrides ---------------------------------------------------
+ /**
+ * Flush is overriden here because in this policy impl
+ * flush might not actually remove all the instances from the cache.
+ * Those instances that are in use (associated with a transaction) should not
+ * be removed from the cache. So, the iteration is done not until the cache is empty
+ * but until we tried to age-out every instance in the cache.
+ */
+ public void flush()
+ {
+ int i = size();
+ LRUCacheEntry entry = null;
+ while (i-- > 0 && (entry = m_list.m_tail) != null)
+ {
+ ageOut(entry);
+ }
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/metadata/ConfigurationMetaData.java
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/metadata/ConfigurationMetaData.java 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/main/org/jboss/metadata/ConfigurationMetaData.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -85,6 +85,9 @@
private ClusterConfigMetaData clusterConfig = null;
/** By the spec ejbStore must be called even for clean instances. But not everyone agrees. */
private boolean ejbStoreForClean;
+ /** Whether dirty instances that couldn't be evicted from the cache after cache.flush()
+ should or should not (to prevent potential data inconsistency) be stored*/
+ private boolean storeNotFlushed = true;
// Static --------------------------------------------------------
@@ -170,7 +173,12 @@
{
return this.ejbStoreForClean;
}
-
+
+ public boolean isStoreNotFlushed()
+ {
+ return storeNotFlushed;
+ }
+
public byte getCommitOption()
{
return commitOption;
@@ -209,6 +217,9 @@
// ejbStoreForClean
ejbStoreForClean = Boolean.valueOf(getElementContent(getOptionalChild(element, "call-ejb-store-on-clean"), String.valueOf(ejbStoreForClean))).booleanValue();
+ // store-not-flushed
+ storeNotFlushed = Boolean.valueOf(getElementContent(getOptionalChild(element, "store-not-flushed"), String.valueOf(storeNotFlushed))).booleanValue();
+
// set the instance pool
instancePool = getElementContent(getOptionalChild(element, "instance-pool"), instancePool);
Modified: branches/JBoss_3_2_8_SP1_CP/server/src/resources/org/jboss/metadata/jboss_3_2.dtd
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/server/src/resources/org/jboss/metadata/jboss_3_2.dtd 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/server/src/resources/org/jboss/metadata/jboss_3_2.dtd 2007-03-27 14:07:55 UTC (rev 61736)
@@ -96,6 +96,7 @@
<sync-on-commit-only />
<insert-after-ejb-post-create />
<call-ejb-store-on-clean />
+ <store-not-flushed />
<container-interceptors />
<instance-pool />
<instance-cache />
@@ -807,7 +808,7 @@
-->
<!ELEMENT container-configuration (container-name , call-logging?,
invoker-proxy-binding-name?, sync-on-commit-only?,
- insert-after-ejb-post-create?, call-ejb-store-on-clean?, container-interceptors? ,
+ insert-after-ejb-post-create?, call-ejb-store-on-clean?, store-not-flushed?, container-interceptors? ,
instance-pool? , instance-cache? , persistence-manager? , web-class-loader? ,
locking-policy? , container-cache-conf? , container-pool-conf? ,
commit-option? , optiond-refresh-rate? , security-domain?, cluster-config?,
@@ -879,6 +880,12 @@
-->
<!ELEMENT call-ejb-store-on-clean (#PCDATA)>
+<!-- The store-not-flushed says whether dirty instances that could not be evicted
+ from the cache should or should not (to prevent potential data inconsistency)
+ be stored. The default value is TRUE.
+-->
+<!ELEMENT store-not-flushed (#PCDATA)>
+
<!--
The container-interceptors element gives the chain of Interceptors
(instances of org.jboss.ejb.Interceptor) that are associated with the container.
Modified: branches/JBoss_3_2_8_SP1_CP/testsuite/imports/sections/cmp.xml
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/imports/sections/cmp.xml 2007-03-27 13:35:31 UTC (rev 61735)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/imports/sections/cmp.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -263,6 +263,32 @@
includes="junit/**/*.*"/>
</jar>
+ <!-- build cmp2-jbas979.jar -->
+ <jar destfile="${build.lib}/cmp2-jbas979.jar">
+ <fileset dir="${build.classes}">
+ <patternset refid="jboss.test.util.ejb.set"/>
+ <include name="org/jboss/test/cmp2/jbas979/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/cmp2/jbas979">
+ <include name="**/*.*"/>
+ </fileset>
+ <zipfileset src="${junit.junit.lib}/junit.jar"
+ includes="junit/**/*.*"/>
+ </jar>
+
+ <!-- build cmp2-jbas979.jar -->
+ <jar destfile="${build.lib}/cmp2-jbas979.jar">
+ <fileset dir="${build.classes}">
+ <patternset refid="jboss.test.util.ejb.set"/>
+ <include name="org/jboss/test/cmp2/jbas979/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/cmp2/jbas979">
+ <include name="**/*.*"/>
+ </fileset>
+ <zipfileset src="${junit.junit.lib}/junit.jar"
+ includes="junit/**/*.*"/>
+ </jar>
+
<!-- build cmp2-keygen.jar -->
<jar destfile="${build.lib}/cmp2-keygen.jar">
<fileset dir="${build.classes}">
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979 (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979)
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-
-import javax.ejb.EntityBean;
-import javax.ejb.EntityContext;
-import javax.ejb.RemoveException;
-import javax.ejb.CreateException;
-import javax.ejb.EJBException;
-import javax.transaction.TransactionManager;
-import javax.transaction.SystemException;
-import org.jboss.tm.TransactionManagerLocator;
-
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- */
-public abstract class ABean implements EntityBean
-{
- private Object longTx;
-
- // CMP accessors --------------------------------------------
- /**
- * @ejb.pk-field
- * @ejb.persistent-field
- * @ejb.interface-method
- */
- public abstract Integer getId();
-
- public abstract void setId(Integer id);
-
- /**
- * @ejb.persistent-field
- * @ejb.interface-method
- */
- public abstract String getName();
-
- /**
- * @ejb.interface-method
- */
- public abstract void setName(String name);
-
- public void longTx() throws Exception
- {
- TransactionManager tm = TransactionManagerLocator.getInstance().locate();
- longTx = tm.getTransaction();
- if(longTx == null)
- {
- throw new EJBException("longTx invoked w/o a transaction!");
- }
- }
-
- /**
- * @throws javax.ejb.CreateException
- * @ejb.create-method
- */
- public Integer ejbCreate(Integer id, String name)
- throws CreateException
- {
- setId(id);
- setName(name);
- return null;
- }
-
- public void ejbPostCreate(Integer id, String name)
- {
- }
-
- /**
- * @param ctx The new entityContext value
- */
- public void setEntityContext(EntityContext ctx)
- {
- }
-
- /**
- * Unset the associated entity context.
- */
- public void unsetEntityContext()
- {
- }
-
- public void ejbActivate()
- {
- }
-
- public void ejbLoad()
- {
- }
-
- public void ejbPassivate()
- {
- TransactionManager tm = TransactionManagerLocator.getInstance().locate();
- try
- {
- // is it safe to check like this? could there be a race condition?
- if(longTx != null && longTx.equals(tm.getTransaction()))
- {
- JBAS979UnitTestCase.PASSIVATED_IN_AFTER_COMPLETION = true;
- }
- else
- {
- JBAS979UnitTestCase.PASSIVATED_IN_AFTER_COMPLETION = false;
- }
- JBAS979UnitTestCase.ERROR_IN_EJB_PASSIVATE = null;
- }
- catch(SystemException e)
- {
- JBAS979UnitTestCase.ERROR_IN_EJB_PASSIVATE = e;
- }
- }
-
- public void ejbRemove() throws RemoveException
- {
- }
-
- public void ejbStore()
- {
- }
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ABean.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.RemoveException;
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.transaction.TransactionManager;
+import javax.transaction.SystemException;
+import org.jboss.tm.TransactionManagerLocator;
+
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision$</tt>
+ */
+public abstract class ABean implements EntityBean
+{
+ private Object longTx;
+
+ // CMP accessors --------------------------------------------
+ /**
+ * @ejb.pk-field
+ * @ejb.persistent-field
+ * @ejb.interface-method
+ */
+ public abstract Integer getId();
+
+ public abstract void setId(Integer id);
+
+ /**
+ * @ejb.persistent-field
+ * @ejb.interface-method
+ */
+ public abstract String getName();
+
+ /**
+ * @ejb.interface-method
+ */
+ public abstract void setName(String name);
+
+ public void longTx() throws Exception
+ {
+ TransactionManager tm = TransactionManagerLocator.getInstance().locate();
+ longTx = tm.getTransaction();
+ if(longTx == null)
+ {
+ throw new EJBException("longTx invoked w/o a transaction!");
+ }
+ }
+
+ /**
+ * @throws javax.ejb.CreateException
+ * @ejb.create-method
+ */
+ public Integer ejbCreate(Integer id, String name)
+ throws CreateException
+ {
+ setId(id);
+ setName(name);
+ return null;
+ }
+
+ public void ejbPostCreate(Integer id, String name)
+ {
+ }
+
+ /**
+ * @param ctx The new entityContext value
+ */
+ public void setEntityContext(EntityContext ctx)
+ {
+ }
+
+ /**
+ * Unset the associated entity context.
+ */
+ public void unsetEntityContext()
+ {
+ }
+
+ public void ejbActivate()
+ {
+ }
+
+ public void ejbLoad()
+ {
+ }
+
+ public void ejbPassivate()
+ {
+ TransactionManager tm = TransactionManagerLocator.getInstance().locate();
+ try
+ {
+ // is it safe to check like this? could there be a race condition?
+ if(longTx != null && longTx.equals(tm.getTransaction()))
+ {
+ JBAS979UnitTestCase.PASSIVATED_IN_AFTER_COMPLETION = true;
+ }
+ else
+ {
+ JBAS979UnitTestCase.PASSIVATED_IN_AFTER_COMPLETION = false;
+ }
+ JBAS979UnitTestCase.ERROR_IN_EJB_PASSIVATE = null;
+ }
+ catch(SystemException e)
+ {
+ JBAS979UnitTestCase.ERROR_IN_EJB_PASSIVATE = e;
+ }
+ }
+
+ public void ejbRemove() throws RemoveException
+ {
+ }
+
+ public void ejbStore()
+ {
+ }
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-public interface ALocal
- extends javax.ejb.EJBLocalObject
-{
- public Integer getId( ) ;
-
- public String getName( ) ;
-
- public void setName( String name ) ;
-
- void longTx() throws Exception;
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocal.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+public interface ALocal
+ extends javax.ejb.EJBLocalObject
+{
+ public Integer getId( ) ;
+
+ public String getName( ) ;
+
+ public void setName( String name ) ;
+
+ void longTx() throws Exception;
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-public interface ALocalHome
- extends javax.ejb.EJBLocalHome
-{
- public ALocal create(Integer id , String name)
- throws javax.ejb.CreateException;
-
- public ALocal findByPrimaryKey(Integer pk)
- throws javax.ejb.FinderException;
-
- public java.util.Collection findAll()
- throws javax.ejb.FinderException;
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/ALocalHome.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+public interface ALocalHome
+ extends javax.ejb.EJBLocalHome
+{
+ public ALocal create(Integer id , String name)
+ throws javax.ejb.CreateException;
+
+ public ALocal findByPrimaryKey(Integer pk)
+ throws javax.ejb.FinderException;
+
+ public java.util.Collection findAll()
+ throws javax.ejb.FinderException;
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- */
-public interface Facade
- extends javax.ejb.EJBObject
-{
- void create(String ejbJndiName, Integer pk, String name)
- throws Exception, java.rmi.RemoteException;
-
- void remove(String ejbJndiName, Integer pk)
- throws Exception, java.rmi.RemoteException;
-
- String getName(String ejbJndiName, Integer pk)
- throws Exception, java.rmi.RemoteException;
-
- String getNameFlushCacheGetName(String ejbJndiName, Integer pk)
- throws Exception, java.rmi.RemoteException;
-
- String getNameFlushCacheSetName(String ejbJndiName, Integer pk, String value)
- throws Exception, java.rmi.RemoteException;
-
- void updateDB(String tableName, Integer pk, String value)
- throws Exception, java.rmi.RemoteException;
-
- void flushCache(String ejbJndiName)
- throws Exception, java.rmi.RemoteException;
-
- void longTx(String ejbJndiName, Integer pk, long ms)
- throws Exception, java.rmi.RemoteException;
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/Facade.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision$</tt>
+ */
+public interface Facade
+ extends javax.ejb.EJBObject
+{
+ void create(String ejbJndiName, Integer pk, String name)
+ throws Exception, java.rmi.RemoteException;
+
+ void remove(String ejbJndiName, Integer pk)
+ throws Exception, java.rmi.RemoteException;
+
+ String getName(String ejbJndiName, Integer pk)
+ throws Exception, java.rmi.RemoteException;
+
+ String getNameFlushCacheGetName(String ejbJndiName, Integer pk)
+ throws Exception, java.rmi.RemoteException;
+
+ String getNameFlushCacheSetName(String ejbJndiName, Integer pk, String value)
+ throws Exception, java.rmi.RemoteException;
+
+ void updateDB(String tableName, Integer pk, String value)
+ throws Exception, java.rmi.RemoteException;
+
+ void flushCache(String ejbJndiName)
+ throws Exception, java.rmi.RemoteException;
+
+ void longTx(String ejbJndiName, Integer pk, long ms)
+ throws Exception, java.rmi.RemoteException;
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- */
-public interface FacadeHome
- extends javax.ejb.EJBHome
-{
- public Facade create()
- throws javax.ejb.CreateException,java.rmi.RemoteException;
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeHome.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision$</tt>
+ */
+public interface FacadeHome
+ extends javax.ejb.EJBHome
+{
+ public Facade create()
+ throws javax.ejb.CreateException,java.rmi.RemoteException;
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,190 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import javax.ejb.SessionBean;
-import javax.ejb.SessionContext;
-import javax.ejb.CreateException;
-import javax.ejb.EJBException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.NamingException;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- */
-public class FacadeSessionBean
- implements SessionBean
-{
- // Business methods
-
- public void create(String ejbJndiName, Integer pk, String name) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- ah.create(pk, name);
- }
-
- public void remove(String ejbJndiName, Integer pk) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- ah.remove(pk);
- }
-
- public String getName(String ejbJndiName, Integer pk) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- return ah.findByPrimaryKey(pk).getName();
- }
-
- public String getNameFlushCacheGetName(String ejbJndiName, Integer pk) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- String nameBeforeFlush = ah.findByPrimaryKey(pk).getName();
- flushCache(ejbJndiName);
- String nameAfterFlush = ah.findByPrimaryKey(pk).getName();
- if(!nameBeforeFlush.equals(nameAfterFlush))
- {
- throw new EJBException(
- "The value of the name field before flush (" + nameBeforeFlush +
- ") is not equal to the value after flush (" + nameAfterFlush + ")!");
- }
- return nameAfterFlush;
- }
-
- public String getNameFlushCacheSetName(String ejbJndiName, Integer pk, String value) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- ah.findByPrimaryKey(pk).getName();
- flushCache(ejbJndiName);
- ALocal a = ah.findByPrimaryKey(pk);
- a.setName(value);
- String name = a.getName();
- if(!name.equals(value))
- {
- throw new EJBException("setName(" + value + ") was ignored: " + name);
- }
- return name;
- }
-
- public void updateDB(String tableName, Integer pk, String value) throws Exception
- {
- DataSource ds = (DataSource)lookup("java:/DefaultDS");
- Connection con = null;
- PreparedStatement st = null;
- try
- {
- con = ds.getConnection();
- st = con.prepareStatement("update " + tableName + " set name=? where id=?");
- st.setString(1, value);
- st.setInt(2, pk.intValue());
- int rowsAffected = st.executeUpdate();
- if(rowsAffected != 1)
- {
- throw new EJBException("Failed to update column name in the row with pk " + pk +
- " in the table " + tableName + ": expected 1 updated row but got " + rowsAffected);
- }
- }
- finally
- {
- JDBCUtil.safeClose(st);
- JDBCUtil.safeClose(con);
- }
- }
-
- public void flushCache(String ejbJndiName) throws Exception
- {
- MBeanServer server = MBeanServerLocator.locateJBoss();
- ObjectName container = new ObjectName("jboss.j2ee:service=EJB,jndiName=" + ejbJndiName);
- server.invoke(container, "flushCache", null, null);
- }
-
- public void longTx(String ejbJndiName, Integer pk, long ms) throws Exception
- {
- ALocalHome ah = getALocalHome(ejbJndiName);
- ah.findByPrimaryKey(pk).longTx();
- try
- {
- Thread.sleep(ms);
- }
- catch(InterruptedException e)
- {
- }
- }
-
- // SessionBean implementation
-
- /**
- * @exception javax.ejb.CreateException Description of Exception
- * @ejb.create-method
- */
- public void ejbCreate() throws CreateException
- {
- }
-
- public void ejbActivate()
- {
- }
-
- public void ejbPassivate()
- {
- }
-
- public void ejbRemove()
- {
- }
-
- public void setSessionContext(SessionContext ctx)
- {
- }
-
- // Private
-
- private ALocalHome getALocalHome(String name)
- throws NamingException
- {
- return (ALocalHome)lookup(name);
- }
-
- private Object lookup(String name) throws NamingException
- {
- InitialContext ic = null;
- try
- {
- ic = new InitialContext();
- return ic.lookup(name);
- }
- finally
- {
- if(ic != null)
- {
- ic.close();
- }
- }
- }
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/FacadeSessionBean.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,190 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class FacadeSessionBean
+ implements SessionBean
+{
+ // Business methods
+
+ public void create(String ejbJndiName, Integer pk, String name) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ ah.create(pk, name);
+ }
+
+ public void remove(String ejbJndiName, Integer pk) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ ah.remove(pk);
+ }
+
+ public String getName(String ejbJndiName, Integer pk) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ return ah.findByPrimaryKey(pk).getName();
+ }
+
+ public String getNameFlushCacheGetName(String ejbJndiName, Integer pk) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ String nameBeforeFlush = ah.findByPrimaryKey(pk).getName();
+ flushCache(ejbJndiName);
+ String nameAfterFlush = ah.findByPrimaryKey(pk).getName();
+ if(!nameBeforeFlush.equals(nameAfterFlush))
+ {
+ throw new EJBException(
+ "The value of the name field before flush (" + nameBeforeFlush +
+ ") is not equal to the value after flush (" + nameAfterFlush + ")!");
+ }
+ return nameAfterFlush;
+ }
+
+ public String getNameFlushCacheSetName(String ejbJndiName, Integer pk, String value) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ ah.findByPrimaryKey(pk).getName();
+ flushCache(ejbJndiName);
+ ALocal a = ah.findByPrimaryKey(pk);
+ a.setName(value);
+ String name = a.getName();
+ if(!name.equals(value))
+ {
+ throw new EJBException("setName(" + value + ") was ignored: " + name);
+ }
+ return name;
+ }
+
+ public void updateDB(String tableName, Integer pk, String value) throws Exception
+ {
+ DataSource ds = (DataSource)lookup("java:/DefaultDS");
+ Connection con = null;
+ PreparedStatement st = null;
+ try
+ {
+ con = ds.getConnection();
+ st = con.prepareStatement("update " + tableName + " set name=? where id=?");
+ st.setString(1, value);
+ st.setInt(2, pk.intValue());
+ int rowsAffected = st.executeUpdate();
+ if(rowsAffected != 1)
+ {
+ throw new EJBException("Failed to update column name in the row with pk " + pk +
+ " in the table " + tableName + ": expected 1 updated row but got " + rowsAffected);
+ }
+ }
+ finally
+ {
+ JDBCUtil.safeClose(st);
+ JDBCUtil.safeClose(con);
+ }
+ }
+
+ public void flushCache(String ejbJndiName) throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName container = new ObjectName("jboss.j2ee:service=EJB,jndiName=" + ejbJndiName);
+ server.invoke(container, "flushCache", null, null);
+ }
+
+ public void longTx(String ejbJndiName, Integer pk, long ms) throws Exception
+ {
+ ALocalHome ah = getALocalHome(ejbJndiName);
+ ah.findByPrimaryKey(pk).longTx();
+ try
+ {
+ Thread.sleep(ms);
+ }
+ catch(InterruptedException e)
+ {
+ }
+ }
+
+ // SessionBean implementation
+
+ /**
+ * @exception javax.ejb.CreateException Description of Exception
+ * @ejb.create-method
+ */
+ public void ejbCreate() throws CreateException
+ {
+ }
+
+ public void ejbActivate()
+ {
+ }
+
+ public void ejbPassivate()
+ {
+ }
+
+ public void ejbRemove()
+ {
+ }
+
+ public void setSessionContext(SessionContext ctx)
+ {
+ }
+
+ // Private
+
+ private ALocalHome getALocalHome(String name)
+ throws NamingException
+ {
+ return (ALocalHome)lookup(name);
+ }
+
+ private Object lookup(String name) throws NamingException
+ {
+ InitialContext ic = null;
+ try
+ {
+ ic = new InitialContext();
+ return ic.lookup(name);
+ }
+ finally
+ {
+ if(ic != null)
+ {
+ ic.close();
+ }
+ }
+ }
+}
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.cmp2.jbas979;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.TransactionRolledbackException;
-import javax.ejb.EJBException;
-import org.jboss.test.JBossTestCase;
-import org.jboss.test.util.ejb.EJBTestCase;
-import junit.framework.Test;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- */
-public class JBAS979UnitTestCase
- extends EJBTestCase
-{
- private static final String STORE_NOT_FLUSHED_FALSE = "AStoreNotFlushedFalse";
- private static final String STORE_NOT_FLUSHED_TRUE = "AStoreNotFlushedTrue";
- private static final Integer PK = new Integer(1);
-
- public static boolean PASSIVATED_IN_AFTER_COMPLETION;
- public static Exception ERROR_IN_EJB_PASSIVATE;
-
- public static Test suite() throws Exception
- {
- return JBossTestCase.getDeploySetup(JBAS979UnitTestCase.class, "cmp2-jbas979.jar");
- }
-
- public JBAS979UnitTestCase(String methodName)
- {
- super(methodName);
- }
-
- protected void setUp() throws Exception
- {
- }
-
- protected void tearDown() throws Exception
- {
- }
-
- // tests
-
- public void testPassivateAfterCommit_storeNotFlushedTrue() throws Exception
- {
- passivateAfterCommit(STORE_NOT_FLUSHED_TRUE);
- }
-
- public void testPassivateAfterCommit_storeNotFlushedFalse() throws Exception
- {
- passivateAfterCommit(STORE_NOT_FLUSHED_FALSE);
- }
-
- public void testUpdateAfterFlush_storeNotFlushedTrue() throws Exception
- {
- String jndiName = STORE_NOT_FLUSHED_TRUE;
- Facade facade = getFacadeHome().create();
- facade.create(jndiName, PK, "name1");
- try
- {
- assertEquals("name2", facade.getNameFlushCacheSetName(jndiName, PK, "name2"));
- }
- finally
- {
- facade.remove(jndiName, PK);
- }
- }
-
- public void testUpdateAfterFlush_storeNotFlushedFalse() throws Exception
- {
- String jndiName = STORE_NOT_FLUSHED_FALSE;
- Facade facade = getFacadeHome().create();
- facade.create(jndiName, PK, "name1");
- try
- {
- facade.getNameFlushCacheSetName(jndiName, PK, "name2");
- fail("Flushed modified instances are not stored.");
- }
- catch(TransactionRolledbackException expected)
- {
- }
- finally
- {
- facade.remove(jndiName, PK);
- }
- }
-
- public void testAgeOutDoesntSchedulePassivationAfterCommit_storeNotFlushedTrue() throws Exception
- {
- ageOutDoesntSchedulePassivationAfterCommit(STORE_NOT_FLUSHED_TRUE);
- }
-
- public void testAgeOutDoesntSchedulePassivationAfterCommit_storeNotFlushedFalse() throws Exception
- {
- ageOutDoesntSchedulePassivationAfterCommit(STORE_NOT_FLUSHED_FALSE);
- }
-
- // Private
-
- private void ageOutDoesntSchedulePassivationAfterCommit(String jndiName)
- throws Exception
- {
- Facade facade = getFacadeHome().create();
- facade.create(jndiName, PK, "name1");
- try
- {
- facade.longTx(jndiName, PK, 5000);
- if(ERROR_IN_EJB_PASSIVATE != null)
- {
- throw new EJBException("Error in ejbPassivate", ERROR_IN_EJB_PASSIVATE);
- }
-
- if(PASSIVATED_IN_AFTER_COMPLETION)
- {
- fail("Natural aging out doesn't schedule passivation when transaction ends.");
- }
- }
- finally
- {
- facade.remove(jndiName, PK);
- }
- }
-
- private void passivateAfterCommit(String jndiName)
- throws Exception
- {
- Facade facade = getFacadeHome().create();
- facade.create(jndiName, PK, "name1");
- try
- {
- String name1 = facade.getName(jndiName, PK);
- facade.updateDB(jndiName, PK, "name2");
- // commit option A
- assertEquals(name1, facade.getNameFlushCacheGetName(jndiName, PK));
- assertEquals("name2", facade.getName(jndiName, PK));
- }
- finally
- {
- facade.remove(jndiName, PK);
- }
- }
-
- private FacadeHome getFacadeHome()
- throws NamingException
- {
- return (FacadeHome)lookup("Facade");
- }
-
- private Object lookup(String name) throws NamingException
- {
- InitialContext ic = null;
- try
- {
- ic = new InitialContext();
- return ic.lookup(name);
- }
- finally
- {
- if(ic != null)
- {
- ic.close();
- }
- }
- }
-}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/main/org/jboss/test/cmp2/jbas979/JBAS979UnitTestCase.java 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cmp2.jbas979;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.transaction.TransactionRolledbackException;
+import javax.ejb.EJBException;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.util.ejb.EJBTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision$</tt>
+ */
+public class JBAS979UnitTestCase
+ extends EJBTestCase
+{
+ private static final String STORE_NOT_FLUSHED_FALSE = "AStoreNotFlushedFalse";
+ private static final String STORE_NOT_FLUSHED_TRUE = "AStoreNotFlushedTrue";
+ private static final Integer PK = new Integer(1);
+
+ public static boolean PASSIVATED_IN_AFTER_COMPLETION;
+ public static Exception ERROR_IN_EJB_PASSIVATE;
+
+ public static Test suite() throws Exception
+ {
+ return JBossTestCase.getDeploySetup(JBAS979UnitTestCase.class, "cmp2-jbas979.jar");
+ }
+
+ public JBAS979UnitTestCase(String methodName)
+ {
+ super(methodName);
+ }
+
+ protected void setUp() throws Exception
+ {
+ }
+
+ protected void tearDown() throws Exception
+ {
+ }
+
+ // tests
+
+ public void testPassivateAfterCommit_storeNotFlushedTrue() throws Exception
+ {
+ passivateAfterCommit(STORE_NOT_FLUSHED_TRUE);
+ }
+
+ public void testPassivateAfterCommit_storeNotFlushedFalse() throws Exception
+ {
+ passivateAfterCommit(STORE_NOT_FLUSHED_FALSE);
+ }
+
+ public void testUpdateAfterFlush_storeNotFlushedTrue() throws Exception
+ {
+ String jndiName = STORE_NOT_FLUSHED_TRUE;
+ Facade facade = getFacadeHome().create();
+ facade.create(jndiName, PK, "name1");
+ try
+ {
+ assertEquals("name2", facade.getNameFlushCacheSetName(jndiName, PK, "name2"));
+ }
+ finally
+ {
+ facade.remove(jndiName, PK);
+ }
+ }
+
+ public void testUpdateAfterFlush_storeNotFlushedFalse() throws Exception
+ {
+ String jndiName = STORE_NOT_FLUSHED_FALSE;
+ Facade facade = getFacadeHome().create();
+ facade.create(jndiName, PK, "name1");
+ try
+ {
+ facade.getNameFlushCacheSetName(jndiName, PK, "name2");
+ fail("Flushed modified instances are not stored.");
+ }
+ catch(TransactionRolledbackException expected)
+ {
+ }
+ finally
+ {
+ facade.remove(jndiName, PK);
+ }
+ }
+
+ public void testAgeOutDoesntSchedulePassivationAfterCommit_storeNotFlushedTrue() throws Exception
+ {
+ ageOutDoesntSchedulePassivationAfterCommit(STORE_NOT_FLUSHED_TRUE);
+ }
+
+ public void testAgeOutDoesntSchedulePassivationAfterCommit_storeNotFlushedFalse() throws Exception
+ {
+ ageOutDoesntSchedulePassivationAfterCommit(STORE_NOT_FLUSHED_FALSE);
+ }
+
+ // Private
+
+ private void ageOutDoesntSchedulePassivationAfterCommit(String jndiName)
+ throws Exception
+ {
+ Facade facade = getFacadeHome().create();
+ facade.create(jndiName, PK, "name1");
+ try
+ {
+ facade.longTx(jndiName, PK, 5000);
+ if(ERROR_IN_EJB_PASSIVATE != null)
+ {
+ throw new EJBException("Error in ejbPassivate", ERROR_IN_EJB_PASSIVATE);
+ }
+
+ if(PASSIVATED_IN_AFTER_COMPLETION)
+ {
+ fail("Natural aging out doesn't schedule passivation when transaction ends.");
+ }
+ }
+ finally
+ {
+ facade.remove(jndiName, PK);
+ }
+ }
+
+ private void passivateAfterCommit(String jndiName)
+ throws Exception
+ {
+ Facade facade = getFacadeHome().create();
+ facade.create(jndiName, PK, "name1");
+ try
+ {
+ String name1 = facade.getName(jndiName, PK);
+ facade.updateDB(jndiName, PK, "name2");
+ // commit option A
+ assertEquals(name1, facade.getNameFlushCacheGetName(jndiName, PK));
+ assertEquals("name2", facade.getName(jndiName, PK));
+ }
+ finally
+ {
+ facade.remove(jndiName, PK);
+ }
+ }
+
+ private FacadeHome getFacadeHome()
+ throws NamingException
+ {
+ return (FacadeHome)lookup("Facade");
+ }
+
+ private Object lookup(String name) throws NamingException
+ {
+ InitialContext ic = null;
+ try
+ {
+ ic = new InitialContext();
+ return ic.lookup(name);
+ }
+ finally
+ {
+ if(ic != null)
+ {
+ ic.close();
+ }
+ }
+ }
+}
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979 (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979)
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF)
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE ejb-jar PUBLIC
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
- "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
-
-<ejb-jar>
- <enterprise-beans>
- <session>
- <description>JUnit Session Bean Test Runner</description>
- <ejb-name>EJBTestRunnerEJB</ejb-name>
- <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
- <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
- <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
- <session-type>Stateless</session-type>
- <transaction-type>Bean</transaction-type>
- </session>
- <session>
- <ejb-name>FacadeEJB</ejb-name>
- <home>org.jboss.test.cmp2.jbas979.FacadeHome</home>
- <remote>org.jboss.test.cmp2.jbas979.Facade</remote>
- <ejb-class>org.jboss.test.cmp2.jbas979.FacadeSessionBean</ejb-class>
- <session-type>Stateless</session-type>
- <transaction-type>Container</transaction-type>
- </session>
- <entity>
- <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
- <local-home>org.jboss.test.cmp2.jbas979.ALocalHome</local-home>
- <local>org.jboss.test.cmp2.jbas979.ALocal</local>
- <ejb-class>org.jboss.test.cmp2.jbas979.ABean</ejb-class>
- <persistence-type>Container</persistence-type>
- <prim-key-class>java.lang.Integer</prim-key-class>
- <reentrant>False</reentrant>
- <cmp-version>2.x</cmp-version>
- <abstract-schema-name>AStoreNotFlushedTrue</abstract-schema-name>
- <cmp-field><field-name>id</field-name></cmp-field>
- <cmp-field><field-name>name</field-name></cmp-field>
- <primkey-field>id</primkey-field>
- <query>
- <query-method>
- <method-name>findAll</method-name>
- <method-params/>
- </query-method>
- <ejb-ql>SELECT OBJECT(o) FROM AStoreNotFlushedTrue o</ejb-ql>
- </query>
- </entity>
- <entity>
- <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
- <local-home>org.jboss.test.cmp2.jbas979.ALocalHome</local-home>
- <local>org.jboss.test.cmp2.jbas979.ALocal</local>
- <ejb-class>org.jboss.test.cmp2.jbas979.ABean</ejb-class>
- <persistence-type>Container</persistence-type>
- <prim-key-class>java.lang.Integer</prim-key-class>
- <reentrant>False</reentrant>
- <cmp-version>2.x</cmp-version>
- <abstract-schema-name>AStoreNotFlushedFalse</abstract-schema-name>
- <cmp-field><field-name>id</field-name></cmp-field>
- <cmp-field><field-name>name</field-name></cmp-field>
- <primkey-field>id</primkey-field>
- <query>
- <query-method>
- <method-name>findAll</method-name>
- <method-params/>
- </query-method>
- <ejb-ql>SELECT OBJECT(o) FROM AStoreNotFlushedFalse o</ejb-ql>
- </query>
- </entity>
- </enterprise-beans>
-
- <assembly-descriptor >
- <container-transaction >
- <method >
- <ejb-name>FacadeEJB</ejb-name>
- <method-name>*</method-name>
- </method>
- <trans-attribute>RequiresNew</trans-attribute>
- </container-transaction>
- </assembly-descriptor>
-</ejb-jar>
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/ejb-jar.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<!DOCTYPE ejb-jar PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+ "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+ <enterprise-beans>
+ <session>
+ <description>JUnit Session Bean Test Runner</description>
+ <ejb-name>EJBTestRunnerEJB</ejb-name>
+ <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
+ <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
+ <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Bean</transaction-type>
+ </session>
+ <session>
+ <ejb-name>FacadeEJB</ejb-name>
+ <home>org.jboss.test.cmp2.jbas979.FacadeHome</home>
+ <remote>org.jboss.test.cmp2.jbas979.Facade</remote>
+ <ejb-class>org.jboss.test.cmp2.jbas979.FacadeSessionBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Container</transaction-type>
+ </session>
+ <entity>
+ <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
+ <local-home>org.jboss.test.cmp2.jbas979.ALocalHome</local-home>
+ <local>org.jboss.test.cmp2.jbas979.ALocal</local>
+ <ejb-class>org.jboss.test.cmp2.jbas979.ABean</ejb-class>
+ <persistence-type>Container</persistence-type>
+ <prim-key-class>java.lang.Integer</prim-key-class>
+ <reentrant>False</reentrant>
+ <cmp-version>2.x</cmp-version>
+ <abstract-schema-name>AStoreNotFlushedTrue</abstract-schema-name>
+ <cmp-field><field-name>id</field-name></cmp-field>
+ <cmp-field><field-name>name</field-name></cmp-field>
+ <primkey-field>id</primkey-field>
+ <query>
+ <query-method>
+ <method-name>findAll</method-name>
+ <method-params/>
+ </query-method>
+ <ejb-ql>SELECT OBJECT(o) FROM AStoreNotFlushedTrue o</ejb-ql>
+ </query>
+ </entity>
+ <entity>
+ <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
+ <local-home>org.jboss.test.cmp2.jbas979.ALocalHome</local-home>
+ <local>org.jboss.test.cmp2.jbas979.ALocal</local>
+ <ejb-class>org.jboss.test.cmp2.jbas979.ABean</ejb-class>
+ <persistence-type>Container</persistence-type>
+ <prim-key-class>java.lang.Integer</prim-key-class>
+ <reentrant>False</reentrant>
+ <cmp-version>2.x</cmp-version>
+ <abstract-schema-name>AStoreNotFlushedFalse</abstract-schema-name>
+ <cmp-field><field-name>id</field-name></cmp-field>
+ <cmp-field><field-name>name</field-name></cmp-field>
+ <primkey-field>id</primkey-field>
+ <query>
+ <query-method>
+ <method-name>findAll</method-name>
+ <method-params/>
+ </query-method>
+ <ejb-ql>SELECT OBJECT(o) FROM AStoreNotFlushedFalse o</ejb-ql>
+ </query>
+ </entity>
+ </enterprise-beans>
+
+ <assembly-descriptor >
+ <container-transaction >
+ <method >
+ <ejb-name>FacadeEJB</ejb-name>
+ <method-name>*</method-name>
+ </method>
+ <trans-attribute>RequiresNew</trans-attribute>
+ </container-transaction>
+ </assembly-descriptor>
+</ejb-jar>
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<jboss>
- <enterprise-beans>
- <entity>
- <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
- <local-jndi-name>AStoreNotFlushedTrue</local-jndi-name>
- <configuration-name>store-not-flushed=true</configuration-name>
- </entity>
- <entity>
- <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
- <local-jndi-name>AStoreNotFlushedFalse</local-jndi-name>
- <configuration-name>store-not-flushed=false</configuration-name>
- </entity>
- <session>
- <ejb-name>EJBTestRunnerEJB</ejb-name>
- <jndi-name>ejb/EJBTestRunner</jndi-name>
- </session>
- <session>
- <ejb-name>FacadeEJB</ejb-name>
- <jndi-name>Facade</jndi-name>
- </session>
- </enterprise-beans>
-
- <container-configurations>
- <container-configuration extends="Standard CMP 2.x EntityBean">
- <container-name>store-not-flushed=true</container-name>
- <store-not-flushed>true</store-not-flushed>
- <container-cache-conf>
- <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
- <cache-policy-conf>
- <min-capacity>50</min-capacity>
- <max-capacity>1000000</max-capacity>
- <overager-period>1</overager-period>
- <max-bean-age>3</max-bean-age>
- <resizer-period>400</resizer-period>
- <max-cache-miss-period>60</max-cache-miss-period>
- <min-cache-miss-period>1</min-cache-miss-period>
- <cache-load-factor>0.75</cache-load-factor>
- </cache-policy-conf>
- </container-cache-conf>
- <commit-option>A</commit-option>
- </container-configuration>
-
- <container-configuration extends="Standard CMP 2.x EntityBean">
- <container-name>store-not-flushed=false</container-name>
- <store-not-flushed>false</store-not-flushed>
- <container-cache-conf>
- <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
- <cache-policy-conf>
- <min-capacity>50</min-capacity>
- <max-capacity>1000000</max-capacity>
- <overager-period>1</overager-period>
- <max-bean-age>3</max-bean-age>
- <resizer-period>400</resizer-period>
- <max-cache-miss-period>60</max-cache-miss-period>
- <min-cache-miss-period>1</min-cache-miss-period>
- <cache-load-factor>0.75</cache-load-factor>
- </cache-policy-conf>
- </container-cache-conf>
- <commit-option>A</commit-option>
- </container-configuration>
- </container-configurations>
-</jboss>
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jboss.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<jboss>
+ <enterprise-beans>
+ <entity>
+ <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
+ <local-jndi-name>AStoreNotFlushedTrue</local-jndi-name>
+ <configuration-name>store-not-flushed=true</configuration-name>
+ </entity>
+ <entity>
+ <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
+ <local-jndi-name>AStoreNotFlushedFalse</local-jndi-name>
+ <configuration-name>store-not-flushed=false</configuration-name>
+ </entity>
+ <session>
+ <ejb-name>EJBTestRunnerEJB</ejb-name>
+ <jndi-name>ejb/EJBTestRunner</jndi-name>
+ </session>
+ <session>
+ <ejb-name>FacadeEJB</ejb-name>
+ <jndi-name>Facade</jndi-name>
+ </session>
+ </enterprise-beans>
+
+ <container-configurations>
+ <container-configuration extends="Standard CMP 2.x EntityBean">
+ <container-name>store-not-flushed=true</container-name>
+ <store-not-flushed>true</store-not-flushed>
+ <container-cache-conf>
+ <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
+ <cache-policy-conf>
+ <min-capacity>50</min-capacity>
+ <max-capacity>1000000</max-capacity>
+ <overager-period>1</overager-period>
+ <max-bean-age>3</max-bean-age>
+ <resizer-period>400</resizer-period>
+ <max-cache-miss-period>60</max-cache-miss-period>
+ <min-cache-miss-period>1</min-cache-miss-period>
+ <cache-load-factor>0.75</cache-load-factor>
+ </cache-policy-conf>
+ </container-cache-conf>
+ <commit-option>A</commit-option>
+ </container-configuration>
+
+ <container-configuration extends="Standard CMP 2.x EntityBean">
+ <container-name>store-not-flushed=false</container-name>
+ <store-not-flushed>false</store-not-flushed>
+ <container-cache-conf>
+ <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
+ <cache-policy-conf>
+ <min-capacity>50</min-capacity>
+ <max-capacity>1000000</max-capacity>
+ <overager-period>1</overager-period>
+ <max-bean-age>3</max-bean-age>
+ <resizer-period>400</resizer-period>
+ <max-cache-miss-period>60</max-cache-miss-period>
+ <min-cache-miss-period>1</min-cache-miss-period>
+ <cache-load-factor>0.75</cache-load-factor>
+ </cache-policy-conf>
+ </container-cache-conf>
+ <commit-option>A</commit-option>
+ </container-configuration>
+ </container-configurations>
+</jboss>
Deleted: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml
===================================================================
--- branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml 2007-02-21 10:45:16 UTC (rev 60752)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jbosscmp-jdbc PUBLIC
- "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
- "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
-<jbosscmp-jdbc>
- <defaults>
- <remove-table>true</remove-table>
- </defaults>
-
- <enterprise-beans>
- <entity>
- <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
- <table-name>AStoreNotFlushedTrue</table-name>
- </entity>
- <entity>
- <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
- <table-name>AStoreNotFlushedFalse</table-name>
- </entity>
- </enterprise-beans>
-</jbosscmp-jdbc>
Copied: branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml (from rev 60752, branches/JBoss_3_2_8_SP1_JBAS-4128/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml)
===================================================================
--- branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml (rev 0)
+++ branches/JBoss_3_2_8_SP1_CP/testsuite/src/resources/cmp2/jbas979/META-INF/jbosscmp-jdbc.xml 2007-03-27 14:07:55 UTC (rev 61736)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jbosscmp-jdbc PUBLIC
+ "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
+<jbosscmp-jdbc>
+ <defaults>
+ <remove-table>true</remove-table>
+ </defaults>
+
+ <enterprise-beans>
+ <entity>
+ <ejb-name>AStoreNotFlushedTrueEJB</ejb-name>
+ <table-name>AStoreNotFlushedTrue</table-name>
+ </entity>
+ <entity>
+ <ejb-name>AStoreNotFlushedFalseEJB</ejb-name>
+ <table-name>AStoreNotFlushedFalse</table-name>
+ </entity>
+ </enterprise-beans>
+</jbosscmp-jdbc>
More information about the jboss-cvs-commits
mailing list