Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2906D11F44 for ; Wed, 21 May 2014 11:36:38 +0000 (UTC) Received: (qmail 85926 invoked by uid 500); 21 May 2014 11:36:38 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 85884 invoked by uid 500); 21 May 2014 11:36:38 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 85876 invoked by uid 99); 21 May 2014 11:36:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 11:36:38 +0000 Date: Wed, 21 May 2014 11:36:37 +0000 (UTC) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OPENJPA-260) Using FetchType.EAGER on OneToMany using jta data source causes result set is closed (DB2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14004590#comment-14004590 ] Rick Curtis commented on OPENJPA-260: ------------------------------------- > For anyone viewing this post in the future, the two properties mentioned will not solve the reported problem. There are no circumstances where setting openjp.RuntimeUnenhancedClasses=supported is the right answer. > Using FetchType.EAGER on OneToMany using jta data source causes result set is closed (DB2) > ------------------------------------------------------------------------------------------ > > Key: OPENJPA-260 > URL: https://issues.apache.org/jira/browse/OPENJPA-260 > Project: OpenJPA > Issue Type: Bug > Components: jpa > Affects Versions: 0.9.7 > Environment: WebSphere Platform 6.1 [BASE 6.1.0.7 cf70711.17] [WEBSERVICES 6.1.0.7 u0712.14] > Host Operating System is Windows XP, version 5.1 build 2600 Service Pack 2 > Java version = J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223ifx-20070323 (JIT enabled) > J9VM - 20070322_12058_lHdSMR > JIT - 20070109_1805ifx3_r8 > GC - WASIFIX_2007, Java Compiler = j9jit23, Java VM name = IBM J9 VM > Reporter: Justin Kilimnik > Priority: Minor > Attachments: log.txt > > > When adding "fetch=FetchType.EAGER" to a OneToMany field on an entity, I get a org.apache.openjpa.persistence.PersistenceException: [ibm][db2][jcc][10120][10898] Invalid operation: result set is closed. exception. This is on a persistence unit that is configured to use JTA Data Source (see config below) (running on WebSphere 6.1.0.7 with DB2 XA Driver). This works when using RESOURCE_LOCAL transaction-type (direct to DB2). The code also works if I remove the "fetch=FetchType.EAGER", therefore I presume there is a bug with the handling of managed transactions with EAGER fetching. > The work around was to add the eager fetching to the query (i.e. "join fetch x.addresses") but I would think that this should work and might need looking in. > persistence.xml: > > org.apache.openjpa.persistence.PersistenceProviderImpl > java:comp/env/jdbc/crsDS > > crs.bus.entity.Customer > crs.bus.entity.Address > crs.bus.entity.CustomerAddress > > > > > > > Entity: > @Entity > @Table(name="Customer", uniqueConstraints={@UniqueConstraint(columnNames="id")}) > public class Customer implements Serializable { > /** .*/ > private static final long serialVersionUID = 4011736633726247664L; > @Id > @GeneratedValue(strategy=GenerationType.IDENTITY) > private long id; > @Basic > private String name; > @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER) > private List addresses; > @Basic > private Date created = new Date(); > .... > } > Exception: > Caused by: <0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException: [ibm][db2][jcc][10120][10898] Invalid operation: result set is closed. > at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3784) > at org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:373) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83) > at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:260) > at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111) > at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57) > at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:876) > at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:834) > at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:756) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776) > at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:257) > at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2152) > at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:251) > at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59) > at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) > at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766) > at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:533) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227) > at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269) > at crs.bus.impl.query.EntityQueries.queryFromPersonName(EntityQueries.java:18) > at crs.bus.impl.CustomerQueryBean.findByPersonName(CustomerQueryBean.java:39) > at crs.bus.proxies.CustomerQueryProxy.findByPersonName(CustomerQueryProxy.java:15) > at crs.service.servant.CustomerQueryServant.findByPersonName(CustomerQueryServant.java:26) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:615) > at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178) > at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:141) > at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:448) > at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:413) > at com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134) > at com.ibm.ws.webservices.engine.dispatchers.java.SessionDispatcher.invoke(SessionDispatcher.java:204) > ... 31 more > Caused by: com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc][10120][10898] Invalid operation: result set is closed. > at com.ibm.db2.jcc.c.wf.mb(wf.java:3193) > at com.ibm.db2.jcc.c.wf.j(wf.java:3164) > at com.ibm.db2.jcc.c.wf.getTimestamp(wf.java:750) > at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getTimestamp(WSJdbcResultSet.java:1994) > at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getTimestamp(DelegatingResultSet.java:166) > at org.apache.openjpa.jdbc.sql.DBDictionary.getTimestamp(DBDictionary.java:727) > at org.apache.openjpa.jdbc.sql.DBDictionary.getDate(DBDictionary.java:594) > at org.apache.openjpa.jdbc.sql.ResultSetResult.getDateInternal(ResultSetResult.java:303) > at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:384) > at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:662) > at org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.loadDataStore(HandlerStrategies.java:205) > at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:172) > at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:788) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:833) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:785) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:336) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:255) > ... 63 more -- This message was sent by Atlassian JIRA (v6.2#6252)