Since you are using WebSphere, I would also suggest opening a PMR for this problem through the normal IBM support channels. If this question does turn into something "real" and requires an iFix, then you'll need the PMR and APAR to get the fix delivered anyway...
Since your query works some of the times and not others, my first guess is that there might be an issue with the SQL cache. You can quickly verify this by turning off the SQL cache via this property. If that works for you, at least you have a workaround until a real fix can be determined. <property name="openjpa.jdbc.QuerySQLCache" value="false"> There are other options with this Cache that might help you out. For example, if turning off the Cache completely gets you around the problem, then you could just turn it off for a specific query. Details can be found in the documentation [1]. Hope this helps get you started. Kevin [1] http://ci.apache.org/projects/openjpa/trunk/docbook/manual.html#ref_guide_cache_querysql On Thu, Jun 13, 2013 at 1:12 PM, javid.alimohideen < javid.alimohid...@gmail.com> wrote: > Hi, > I have web application running on Websphere v8.5, that uses a JPA project > configured as utility project. The application suddenly started throwing > ClassCastException when performing select query. I have pasted the > exception > stack trace. The weird things is it works sometime and at times I get this > exception. Also, if the DB tables have just one record then everything > works > fine, if there are more than 1 record then I see this exception > > The entities have a OneToMany and ManyToOne relationships defined. > > Caused by: java.lang.ClassCastException: org.apache.openjpa.util.IntId > incompatible with com.jpa.dom.transactionqueue.BlockTransactionQueue > at > > com.jpa.dom.transactionqueue.BlockCompleteTransaction.pcReplaceField(BlockCompleteTransaction.java) > at > > org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:3174) > at > > org.apache.openjpa.kernel.StateManagerImpl.storeObjectField(StateManagerImpl.java:2602) > at > > org.apache.openjpa.kernel.StateManagerImpl.storeObject(StateManagerImpl.java:2592) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setMappedBy(JDBCStoreManager.java:476) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:402) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:304) > at > > com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.initialize(WsJpaJDBCStoreManager.java:149) > at > > org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112) > at > > org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) > at > org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1036) > at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:994) > > I can post any additional detail if needed. please, let me know. > > Thanks > > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/ClassCastException-org-apache-openjpa-util-IntId-incompatible-tp7584145.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >