[JBoss Cache: Core Edition] - JBosscache dirty read even though isolation is REPEATABLE_RE
by vishwasoft
I'm trying to evaluate the JBossCache for our application
I'm getting dirty read even though I rollback transaction. I tried this with EJB3 Stateless session bean BMT.
Could you please anyone help me on this prolbem, Am I making anything wrong?
Here is the code
public class TestEntity {
private int array[] = new int[100000];
public void update(int value) {
for (int i = 0; i < array.length; i++) {
array [ i ]=value;
}
}
public int[] getArray() {
return array;
}
}
Stateless Bean code to update cache
Stateless Bean 1
public void updateArray(int value) {
TransactionManager tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
try {
tm.begin();
String key = node.getFqn().toString();
TestEntity t = (TestEntity) node.get(key);
if(t != null) {
t.update(value);
node.put(key, t);
}
tm.rollback();
} catch (Exception e) {
try {
tm.rollback();
}catch(Exception ex1) {
ex1.printStackTrace();
}
e.printStackTrace();
}
}
Stateless Bean 2 to read and validating array
public boolean validateArray() {
TransactionManager tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
try {
tm.begin();
cache.getInvocationContext().getOptionOverrides().setForceWriteLock(true);
int a[] = readArray();
int value = a[0];
for (int i = 0; i < a.length; i++) {
if(a != value) {
System.out.println(a+":"+value);
sctx.getUserTransaction().rollback();
return false;
}
}
tm.commit();
}catch(Exception ex) {
try {
tm.rollback();
}catch(Exception ex1) {
ex1.printStackTrace();
}
ex.printStackTrace();
}
return true;
}
Configuration file:
I have used configuration file example for cache configuration
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238848#4238848
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238848
16 years, 10 months
[EJB 3.0] - Re: Stateful EJB hanging in JNDI namespace - JBAS bug?
by ozizka@redhat.com
Caused by: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.j2ee:jar=ejb-stateful-1.0-SNAPSHOT.jar,name=CounterXBean,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:jar=ejb-stateful-1.0-SNAPSHOT.jar,name=CounterXBean,service=EJB3" (should be in state "Configured", but is actually in state "**ERROR**")
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:jar=ejb-stateful-1.0-SNAPSHOT.jar,name=CounterXBean,service=EJB3" is in error due to the following reason(s): **ERROR**, java.lang.IllegalStateException: ProxyFactory/ejb-stateful-1.0-SNAPSHOT/CounterXBean/CounterXBean/remote is already installed.
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.start(AbstractDeployHandler.java:265)
at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:177)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
at org.jboss.remoting.Client.invoke(Client.java:1724)
at org.jboss.remoting.Client.invoke(Client.java:629)
at org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget.invoke(StreamingDeploymentTarget.java:305)
... 17 more
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238844#4238844
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238844
16 years, 10 months