You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Justin Kilimnik (JIRA)" <ji...@apache.org> on 2007/06/18 15:00:50 UTC

[jira] Issue Comment Edited: (OPENJPA-260) Using FetchType.EAGER on OneToMany using jta data source causes result set is closed (DB2)

    [ https://issues.apache.org/jira/browse/OPENJPA-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505804 ] 

Justin Kilimnik edited comment on OPENJPA-260 at 6/18/07 6:00 AM:
------------------------------------------------------------------

Here is the condensed log:

[18/06/07 13:55:41:703 BST] 0000001f SystemErr     R 2766  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> executing prepstmnt 593765220 SELECT t0.id, t0.created, t0.name FROM Customer t0 WHERE (t0.name LIKE ? ESCAPE '\')  [params=(String) Brad%]
[18/06/07 13:55:42:343 BST] 0000001f SystemErr     R 3406  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> [640 ms] spent
[18/06/07 13:55:42:359 BST] 0000001f SystemErr     R 3422  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> executing prepstmnt 16646398 SELECT t0.id, t2.cid, t3.id, t3.city, t3.country, t3.flatNumber, t3.houseName, t3.number, t3.postcode, t3.streetName, t2.name FROM Customer t0 INNER JOIN Customer_CustomerAddress t1 ON t0.id = t1.Customer_id INNER JOIN CustomerAddress t2 ON t1.addresses_cid = t2.cid LEFT OUTER JOIN Address t3 ON t2.address_id = t3.id WHERE (t0.name LIKE ? ESCAPE '\') ORDER BY t0.id ASC  [params=(String) Brad%]
[18/06/07 13:55:42:359 BST] 0000001f SystemErr     R 3422  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> [0 ms] spent
[18/06/07 13:55:42:468 BST] 0000001f ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrvWS01\logs\ffdc\server1_16e416e4_07.06.18_13.55.42_0.txt
[18/06/07 13:55:42:531 BST] 0000001f ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrvWS01\logs\ffdc\server1_16e416e4_07.06.18_13.55.42_0.txt
[18/06/07 13:55:42:578 BST] 0000001f SystemErr     R <0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException: [ibm][db2][jcc][10120][10898] Invalid operation: result set is closed.

I will attach the complete log. 

I didn't use any specific features (ie. fetch plans).

The code was:

...
	@OneToMany(cascade={CascadeType.ALL},fetch=FetchType.EAGER)
	private List<CustomerAddress> addresses;
...

Regards, Justin


 was:
Here is the condensed log:

[18/06/07 13:55:41:703 BST] 0000001f SystemErr     R 2766  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> executing prepstmnt 593765220 SELECT t0.id, t0.created, t0.name FROM Customer t0 WHERE (t0.name LIKE ? ESCAPE '\')  [params=(String) Brad%]
[18/06/07 13:55:42:343 BST] 0000001f SystemErr     R 3406  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> [640 ms] spent
[18/06/07 13:55:42:359 BST] 0000001f SystemErr     R 3422  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> executing prepstmnt 16646398 SELECT t0.id, t2.cid, t3.id, t3.city, t3.country, t3.flatNumber, t3.houseName, t3.number, t3.postcode, t3.streetName, t2.name FROM Customer t0 INNER JOIN Customer_CustomerAddress t1 ON t0.id = t1.Customer_id INNER JOIN CustomerAddress t2 ON t1.addresses_cid = t2.cid LEFT OUTER JOIN Address t3 ON t2.address_id = t3.id WHERE (t0.name LIKE ? ESCAPE '\') ORDER BY t0.id ASC  [params=(String) Brad%]
[18/06/07 13:55:42:359 BST] 0000001f SystemErr     R 3422  crs  TRACE  [WebContainer : 0] openjpa.jdbc.SQL - <t 384046820, conn 745155690> [0 ms] spent
[18/06/07 13:55:42:468 BST] 0000001f ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrvWS01\logs\ffdc\server1_16e416e4_07.06.18_13.55.42_0.txt
[18/06/07 13:55:42:531 BST] 0000001f ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrvWS01\logs\ffdc\server1_16e416e4_07.06.18_13.55.42_0.txt
[18/06/07 13:55:42:578 BST] 0000001f SystemErr     R <0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException: [ibm][db2][jcc][10120][10898] Invalid operation: result set is closed.

I will attach the complete log. 

I didn't use any specific features (ie. fetch plans).

Regards, Justin

> 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:
> 	<persistence-unit name="crs" transaction-type="JTA">
> 		<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> 		<jta-data-source>java:comp/env/jdbc/crsDS</jta-data-source>
> 		
> 		<class>crs.bus.entity.Customer</class>
>   		<class>crs.bus.entity.Address</class>
> 		<class>crs.bus.entity.CustomerAddress</class>
> 				
> 		<properties>
>  			<property name="openjpa.TransactionMode" value="managed" />
> 			<property name="openjpa.ConnectionFactoryMode" value="managed" />
> 			<property name="openjpa.jdbc.DBDictionary" value="db2" />
> 		</properties>
> 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<CustomerAddress> 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.<init>(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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.