Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-9662

iterable results not closed in automation

    XMLWordPrintable

    Details

    • Impact type:
      API change

      Description

      In remote automation, an operation may return an org.nuxeo.ecm.core.api.IterableQueryResult. The results are well serialized by jackson and sent back to the client. But, the iterable is not closed. At garbage time, outside the transaction, the iterable is checked and closed (see finalize method). This causes oracle to report an error and let the connection unusable.

      2012-07-02 10:23:36,301 WARN  Finalizer {} [org.nuxeo.ecm.core.storage.sql.jdbc.JDBCLogger] (19) SQL: Closing an IterableQueryResult for you. Please close them yourself.
      2012-07-02 10:23:36,307 ERROR http-0.0.0.0-8080-2 {} [org.nuxeo.ecm.core.storage.sql.coremodel.SQLQueryResult] Could not fetch documents for ids: [1f6e5e54-b061-44a5-9d1a-f171406cb661, d4359db0-220a-43f6-901c-334ccbf37c50, d0817fd4-fd2d-4909-95e3-72ed8c96a9bd, 6d5d9fe4-aaa9-4ad2-ae83-7aa4c318d5b4, 2be56a5a-fd78-4df9-87ed-0c3974c9f2e4, 9dbbdb52-f3e9-44fa-b8a7-02a3d65a358f]
      org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: Cannot use closed connection handle: org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl@737db326
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getDocumentsById(SQLSession.java:699)
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLQueryResult.getDocumentModels(SQLQueryResult.java:97)
      	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1470)
      	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1423)
      	at sun.reflect.GeneratedMethodAccessor902.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:128)
      	at $Proxy45.query(Unknown Source)
      	at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.getCurrentPage(CoreQueryDocumentPageProvider.java:93)
      

      One solution will be to configure a specific serializer for doing the job. But, this will let another miss usage of the query result in another part of the application.

      A better solution will be to register the returned iterable query results in the storage session and to close at the end and close callback.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: