[JBossCache] - Problem with JBoss JDBCCacheLoader
by archanaa_panda
Hello,
We are using JBoss Cache 1.3 for our project which is under development. Recently while doing some performance testing we found a problem with the JDBC Cache Loader (we are using an Oracle database as the backing store for our JBoss Cache). When we run with multiple threads or sometimes even one thread, we get the following exception:
java.lang.RuntimeException: java.lang.IllegalStateException: Failed to insert node: ORA-00001: unique constraint (FASTDEV.JBOSSCACHE_PK) violated at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:4810)
at org.jboss.cache.TreeCache.put(TreeCache.java:3242)
at com.sisl.ashleycomm.cache.CacheTimeoutManager.putCacheable(CacheTimeoutManager.java:452)
at com.sisl.ashleycomm.cache.push.command.MobilePushCacheTimeoutManager.putCacheable(MobilePushCacheTimeoutManager.java:168)
at com.sisl.ashleycomm.cache.DefaultCacheableVersionProxy.processEvent(DefaultCacheableVersionProxy.java:134)
at com.sisl.ashleycomm.cache.push.command.MobilePushCacheTimeoutManager.getMobilePushCommandsForGprsSend
Caused by: java.lang.IllegalStateException: Failed to insert node: ORA-00001: unique constraint (FASTDEV.JBOSSCACHE_PK) violated
at org.jboss.cache.loader.JDBCCacheLoader.insertNode(JDBCCacheLoader.java:982)
at org.jboss.cache.loader.JDBCCacheLoader.put(JDBCCacheLoader.java:325)
at org.jboss.cache.interceptors.CacheStoreInterceptor.invoke(CacheStoreInterceptor.java:202)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:187)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:328)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:139)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:67)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:153)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:4804)
Actually the scenario is like this:
A thread gets a node on the cache and then does some modification on the node and tries to put it back on the cache.
There may be multiple threads accessing the same node.
Looking at the source code of JBoss Cache 1.3, I find that when put() is called on JDBCCacheLoader, loadNode() method is called. Apparantly this is returning null so the insertNode() is being called. But then when it tries to do the insertNode, it gets the PK violated error which indicates the row was existing in the database already!!!
What are the precautions we need to take to avoid this problem? Is our setting wrong?
A quick reply would be very much appreciated. Please let me know if there are more details required for diagnosing the problem
Thanks and Regards,
Archanaa Panda
Following are the details of our cache config xml file-
<attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
| <attribute name="IsolationLevel">READ_COMMITTED</attribute>
| <attribute name="CacheMode">REPL_SYNC</attribute>
|
|
| <attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>false</passivation>
| <preload>/</preload>
| <shared>true</shared>
| <cacheloader>
| <class>org.jboss.cache.loader.JDBCCacheLoader</class>
| <properties>
| cache.jdbc.table.name=jbosscache
| cache.jdbc.table.create=true
| cache.jdbc.table.drop=false
| cache.jdbc.table.primarykey=jbosscache_pk
| cache.jdbc.fqn.column=fqn
| cache.jdbc.fqn.type=varchar(255)
| cache.jdbc.node.column=node
| cache.jdbc.node.type=blob
| cache.jdbc.parent.column=parent
| cache.jdbc.driver=oracle.jdbc.driver.OracleDriver
| cache.jdbc.url=jdbc:oracle:thin:@132.186.106.26:1541:ACRMDEV
| cache.jdbc.user=FASTDEV
| cache.jdbc.password=fastdev123$
| </properties>
| <async>false</async>
| <fetchPersistentState>true</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| </cacheloader>
| </config>
| </attribute>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990965#3990965
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990965
18 years, 1 month
[JBoss Portal] - unable to deploy jboss portal (build created from open sourc
by anjana
I have created the jboss-portal.sar from open source jboss portal version 2.4. when i try to deploy onn jboss 4.04.GA if fails with following exception
2006-12-04 16:26:34,055 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Loading portlet class org.jboss.portal.core.portlet.test.BasicPortlet
2006-12-04 16:26:34,055 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Creating portlet object org.jboss.portal.core.portlet.test.BasicPortlet
2006-12-04 16:26:34,070 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Created portlet object org.jboss.portal.core.portlet.test.BasicPortlet
2006-12-04 16:26:34,070 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Initialized portlet object org.jboss.portal.core.portlet.test.BasicPortlet
2006-12-04 16:26:34,070 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Looking for the WEB-INF path of samples
2006-12-04 16:26:34,084 ERROR [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Error when creating instances
org.hibernate.HibernateException: Unable to locate current JTA transaction
i have create the portal-mysql-ds.xml with following entries
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>PortalDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<user-name>portal</user-name>
portalpassword
</local-tx-datasource>
the above file is copied into Jboss folder
\server\default\deploy
can anyone pls guide what is missiing in my environment
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990964#3990964
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990964
18 years, 1 month
[EJB 3.0] - Re: @PrePersist @PreUpdate within @AroundInvoke results in c
by gnulp
but that means that you have NO chance to intercept a business-logic call from a client who is doing an update on an entity that has cascading enabled !!!
Assume 2 entities e.g. person [1:n] address. You have got a business-method that can be called with person as an attribute only, and the client changed a referenced address-object (remember cascade all is enabled !). So we get a call-back in the pre-update-Method of the address, but we will never know that in the interceptor of the business-logic call, due to the late update-callback (unfortunaltelly we can not use an entityManager in listener-callbacks, but we have also no chance doing this in an interceptor !!!)
In other words I would have to check weather any address-object has changed myself although I am using ejb3 that is doing these things anyhow ! So why am I using ejb3, if I have to reinvent the wheel ?
Thx for any feedback
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990963#3990963
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990963
18 years, 1 month