Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bug with new 5.1p DSTransaction and cacheSyncOperation transaction

    Hi Isomorphic,

    please see this 5.1p (SNAPSHOT_v10.1p_2015-12-10/PowerEdition) BuiltInDS based Oracle testcase, where the cacheSyncOperation seems to use a different transaction than the add-request and therefore does not return a row.
    I tried with HSQLDB as well, but the result is different there and I'm using Oracle in my application.

    Prerequisites:
    server.properties:
    Code:
    sql.defaultDatabase: Oracle
    sql.Oracle.driver: oracle.jdbc.pool.OracleDataSource
    sql.Oracle.driver.serverName: localhost
    sql.Oracle.driver.portNumber: 1521
    sql.Oracle.driver.databaseName: XE
    sql.Oracle.driver.user: removed
    sql.Oracle.driver.password: removed
    web.xml:
    Code:
        <servlet>
            <servlet-name>AddToSupplyItemServlet</servlet-name>
            <servlet-class>com.smartgwt.sample.server.listener.AddToSupplyItemServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>AddToSupplyItemServlet</servlet-name>
            <url-pattern>/AddToSupplyItemServlet</url-pattern>
        </servlet-mapping>
    DDL:
    Code:
    CREATE SEQUENCE supplyitem_itemid MINVALUE 1 ;
    
    CREATE TABLE supplyitem
        (
          itemid       INTEGER,
          itemname     VARCHAR2(128 BYTE),
          sku          VARCHAR2(10 BYTE),
          description  VARCHAR2(2000 BYTE),
          category     VARCHAR2(128 BYTE),
          units        VARCHAR2(5 BYTE),
          unitcost     NUMBER DEFAULT 0,
          instock      VARCHAR2(6 BYTE),
          nextshipment DATE,
          CONSTRAINT pk_supplyitem PRIMARY KEY(itemid)
        ) ;
    CREATE OR REPLACE TRIGGER supplyitem_b_i_r BEFORE
       INSERT ON supplyitem FOR EACH ROW WHEN(NEW.itemid IS NULL) BEGIN :NEW.itemid := supplyitem_itemid.nextval;
    END;
    /
    AddToSupplyItemServlet.java
    Code:
    package com.smartgwt.sample.server.listener;
    
    import java.io.IOException;
    import java.math.BigDecimal;
    import java.util.HashMap;
    import java.util.Map;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import com.isomorphic.datasource.DSRequest;
    import com.isomorphic.datasource.DSResponse;
    import com.isomorphic.datasource.DSTransaction;
    import com.isomorphic.datasource.DataSource;
    import com.isomorphic.log.Logger;
    
    public class AddToSupplyItemServlet extends HttpServlet {
        private static final long serialVersionUID = -536025913450167992L;
    
        @Override
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            try {
                addData(request, response);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        @Override
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doGet(request, response);
        }
    
        private void addData(HttpServletRequest request, HttpServletResponse response) throws Exception {
            Logger l = new Logger(com.isomorphic.sql.SQLDataSource.class);
            DSTransaction dst = new DSTransaction();
            DSResponse leadAddResponse = null;
            {
                DSRequest leadAddRequest = new DSRequest("supplyItem", DataSource.OP_ADD);
                leadAddRequest.setDsTransaction(dst);
    
                Map<String, Object> newValues = new HashMap<String, Object>(4);
                newValues.put("itemName", "Blue two pence");
                newValues.put("SKU", "0123456789");
                newValues.put("category", "Stamps");
                newValues.put("unitCost", 1000000);
    
                leadAddRequest.setValues(newValues);
                try {
                    leadAddResponse = leadAddRequest.execute();
                } catch (Exception e) {
                    l.warn("Error executing request");
                    e.printStackTrace();
                } finally {
                    dst.complete();
                }
            }
    
            Long newID;
            try {
                newID = ((BigDecimal) leadAddResponse.getRecord().get("itemID")).longValueExact();
                l.warn("New ID extracted from response: " + newID);
            } catch (NumberFormatException nfe) {
                l.warn("Could not extract new ID");
                nfe.printStackTrace();
            } catch (NullPointerException npe) {
                l.warn("NPE catched.");
                npe.printStackTrace();
            }
        }
    };
    If you hit this servlet in devmode (http://127.0.0.1:8888/AddToSupplyItemServlet), you'll get the following log (important parts highlighted):
    Code:
    === 2015-12-16 11:59:53,919 [1-26] INFO  RequestContext - URL: '/AddToSupplyItemServlet', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36': Safari with Accept-Encoding header
    === 2015-12-16 11:59:53,920 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'supplyItem'
    === 2015-12-16 11:59:53,920 [1-26] DEBUG PoolableDataSourceFactory - Activated DataSource 10 of type 'supplyItem'
    === 2015-12-16 11:59:53,921 [1-26] DEBUG DSRequest - Caching instance 10 of DS 'supplyItem' from DSRequest.getDataSource()
    === 2015-12-16 11:59:53,921 [1-26] DEBUG DSRequest - Caching instance 10 of DS supplyItem
    === 2015-12-16 11:59:53,921 [1-26] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2015-12-16 11:59:53,922 [1-26] DEBUG DeclarativeSecurity - Request is not a client request, ignoring security checks.
    === 2015-12-16 11:59:53,922 [1-26] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-12-16 11:59:53,923 [1-26] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-12-16 11:59:53,925 [1-26] INFO  SQLDataSource - [builtinApplication.null] Performing add operation with
        criteria: {unitCost:1000000,category:"Stamps",SKU:"0123456789",itemName:"Blue two pence"}    values: {unitCost:1000000.0,category:"Stamps",SKU:"0123456789",itemName:"Blue two pence"}
    === 2015-12-16 11:59:53,926 [1-26] DEBUG SQLValuesClause - [builtinApplication.null] Sequences: {itemID=__default}
    === 2015-12-16 11:59:53,929 [1-26] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] Executing pingTest 'select 1 from dual' on connection 1713494657
    === 2015-12-16 11:59:53,930 [1-26] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '[B]1713494657[/B]'
    === 2015-12-16 11:59:53,931 [1-26] DEBUG SQLTransaction - [builtinApplication.null] Started new Oracle transaction "[B]1713494657[/B]"
    === 2015-12-16 11:59:53,931 [1-26] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
    === 2015-12-16 11:59:53,931 [1-26] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1713494657': INSERT INTO supplyItem (SKU, category, itemName, unitCost, itemID) VALUES ('0123456789', 'Stamps', 'Blue two pence', 1000000.0, supplyItem_itemID.NextVal)
    === 2015-12-16 11:59:53,935 [1-26] DEBUG SQLDriver - [builtinApplication.null] SequenceMode is not JDBC_DRIVER, skipping search for generated values
    === 2015-12-16 11:59:53,935 [1-26] DEBUG SQLDataSource - [builtinApplication.null] add operation affected 1 rows
    === 2015-12-16 11:59:53,935 [1-26] DEBUG SQLDataSource - [builtinApplication.null] Setting DSRequest as being part of a transaction
    === 2015-12-16 11:59:53,936 [1-26] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '1713494657': SELECT supplyItem_itemID.CurrVal FROM DUAL
    === 2015-12-16 11:59:53,939 [1-26] INFO  SQLDataSource - [builtinApplication.null] primaryKeys: {itemID=3344}
    === 2015-12-16 11:59:53,939 [1-26] DEBUG DeclarativeSecurity - [builtinApplication.null] Processing security checks for DataSource null, field null
    === 2015-12-16 11:59:53,939 [1-26] DEBUG DeclarativeSecurity - [builtinApplication.null] Request is not a client request, ignoring security checks.
    === 2015-12-16 11:59:53,940 [1-26] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-12-16 11:59:53,940 [1-26] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-12-16 11:59:53,941 [1-26] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] Performing fetch operation with
        criteria: {itemID:"3344"}    values: {itemID:"3344"}
    === 2015-12-16 11:59:53,943 [1-26] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-12-16 11:59:53,944 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-12-16 11:59:53,945 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Eval'd row count query: SELECT COUNT(*) FROM supplyItem WHERE (supplyItem.itemID=3344)
    === 2015-12-16 11:59:53,945 [1-26] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null, builtinApplication.null] Executing pingTest 'select 1 from dual' on connection 1913530818
    === 2015-12-16 11:59:53,947 [1-26] DEBUG SQLConnectionManager - [builtinApplication.null, builtinApplication.null] Borrowed connection '[B]1913530818[/B]'
    === 2015-12-16 11:59:53,947 [1-26] INFO  SQLDriver - [builtinApplication.null, builtinApplication.null] Executing SQL query on 'Oracle' using connection '[B]1913530818[/B]': SELECT COUNT(*) FROM supplyItem WHERE (supplyItem.itemID=3344)
    [B]=== 2015-12-16 11:59:53,950 [1-26] INFO  DSResponse - [builtinApplication.null] DSResponse: List with 0 items[/B]
    === 2015-12-16 11:59:53,951 [1-26] DEBUG DSRequest - [builtinApplication.null] About to free up resources for request of type fetch on DataSource supplyItem
    === 2015-12-16 11:59:53,951 [1-26] DEBUG DSRequest - [builtinApplication.null] Ignoring freeResources call because this is not a primary request!
    === 2015-12-16 11:59:53,951 [1-26] DEBUG DSRequest - [builtinApplication.null] Ignoring freeQueueResources call because this is not a primary request!
    === 2015-12-16 11:59:53,951 [1-26] INFO  DSResponse - DSResponse: List with 0 items
    === 2015-12-16 11:59:53,951 [1-26] DEBUG DSRequest - freeOnExecute is false for request of type add on DataSource supplyItem - not freeing resources!
    === 2015-12-16 11:59:53,951 [1-26] DEBUG SQLTransaction - Committing Oracle transaction "1713494657"
    === 2015-12-16 11:59:53,952 [1-26] DEBUG SQLTransaction - getConnection() looked for transactional connection for Oracle:  hashcode "1713494657"
    === 2015-12-16 11:59:53,952 [1-26] DEBUG SQLTransaction - Ending Oracle transaction "1713494657"
    === 2015-12-16 11:59:53,953 [1-26] DEBUG SQLConnectionManager - About to close connection with hashcode "1713494657"
    === 2015-12-16 11:59:53,953 [1-26] DEBUG PoolableSQLConnectionFactory - Executing pingTest 'select 1 from dual' on connection 1713494657
    === 2015-12-16 11:59:53,954 [1-26] DEBUG PoolableSQLConnectionFactory - Passivating connection '1713494657
    === 2015-12-16 11:59:53,954 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:53,954 [1-26] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1913530818 for SQLDriver instance 665598422
    === 2015-12-16 11:59:53,955 [1-26] DEBUG SQLConnectionManager - About to close connection with hashcode "1913530818"
    === 2015-12-16 11:59:53,955 [1-26] DEBUG PoolableSQLConnectionFactory - Executing pingTest 'select 1 from dual' on connection 1913530818
    === 2015-12-16 11:59:53,956 [1-26] DEBUG PoolableSQLConnectionFactory - Passivating connection '1913530818
    === 2015-12-16 11:59:53,957 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:53,957 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:53,957 [1-26] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 10 of type 'supplyItem'
    === 2015-12-16 11:59:53,957 [1-26] WARN  SQLDataSource - NPE catched.
    java.lang.NullPointerException
        at com.smartgwt.sample.server.listener.AddToSupplyItemServlet.addData(AddToSupplyItemServlet.java:63)
        at com.smartgwt.sample.server.listener.AddToSupplyItemServlet.doGet(AddToSupplyItemServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Unknown Source)
    If you comment out the two transaction related lines:
    Code:
                leadAddRequest.setDsTransaction(dst); //line 42
                dst.complete(); //line 57
    you'll get a better log (again with highlighting):
    Code:
    === 2015-12-16 11:59:27,758 [1-26] INFO  RequestContext - URL: '/AddToSupplyItemServlet', User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36': Safari with Accept-Encoding header
    === 2015-12-16 11:59:27,760 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'supplyItem'
    === 2015-12-16 11:59:27,760 [1-26] DEBUG PoolableDataSourceFactory - Activated DataSource 10 of type 'supplyItem'
    === 2015-12-16 11:59:27,761 [1-26] DEBUG DSRequest - Caching instance 10 of DS 'supplyItem' from DSRequest.getDataSource()
    === 2015-12-16 11:59:27,761 [1-26] DEBUG DSRequest - Caching instance 10 of DS supplyItem
    === 2015-12-16 11:59:27,761 [1-26] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2015-12-16 11:59:27,762 [1-26] DEBUG DeclarativeSecurity - Request is not a client request, ignoring security checks.
    === 2015-12-16 11:59:27,762 [1-26] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-12-16 11:59:27,762 [1-26] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-12-16 11:59:27,766 [1-26] INFO  SQLDataSource - [builtinApplication.null] Performing add operation with
        criteria: {unitCost:1000000,category:"Stamps",SKU:"0123456789",itemName:"Blue two pence"}    values: {unitCost:1000000.0,category:"Stamps",SKU:"0123456789",itemName:"Blue two pence"}
    === 2015-12-16 11:59:27,769 [1-26] DEBUG SQLValuesClause - [builtinApplication.null] Sequences: {itemID=__default}
    === 2015-12-16 11:59:27,772 [1-26] INFO  SQLDriver - [builtinApplication.null] DSRequest has no DSTransaction set, when testing if we should join a transaction - transaction will not be joined
    === 2015-12-16 11:59:27,773 [1-26] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] Executing pingTest 'select 1 from dual' on connection 1713494657
    === 2015-12-16 11:59:27,775 [1-26] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '1713494657'
    === 2015-12-16 11:59:27,775 [1-26] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '[B]1713494657[/B]': INSERT INTO supplyItem (SKU, category, itemName, unitCost, itemID) VALUES ('0123456789', 'Stamps', 'Blue two pence', 1000000.0, supplyItem_itemID.NextVal)
    === 2015-12-16 11:59:27,778 [1-26] DEBUG SQLDriver - [builtinApplication.null] SequenceMode is not JDBC_DRIVER, skipping search for generated values
    === 2015-12-16 11:59:27,778 [1-26] DEBUG SQLDataSource - [builtinApplication.null] add operation affected 1 rows
    === 2015-12-16 11:59:27,779 [1-26] INFO  SQLDriver - [builtinApplication.null] Executing SQL query on 'Oracle' using connection '[B]1713494657[/B]': SELECT supplyItem_itemID.CurrVal FROM DUAL
    === 2015-12-16 11:59:27,781 [1-26] INFO  SQLDataSource - [builtinApplication.null] primaryKeys: {itemID=3343}
    === 2015-12-16 11:59:27,781 [1-26] DEBUG DeclarativeSecurity - [builtinApplication.null] Processing security checks for DataSource null, field null
    === 2015-12-16 11:59:27,781 [1-26] DEBUG DeclarativeSecurity - [builtinApplication.null] Request is not a client request, ignoring security checks.
    === 2015-12-16 11:59:27,782 [1-26] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-12-16 11:59:27,782 [1-26] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-12-16 11:59:27,783 [1-26] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] Performing fetch operation with
        criteria: {itemID:"3343"}    values: {itemID:"3343"}
    === 2015-12-16 11:59:27,784 [1-26] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-12-16 11:59:27,785 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
    === 2015-12-16 11:59:27,786 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Eval'd row count query: SELECT COUNT(*) FROM supplyItem WHERE (supplyItem.itemID=3343)
    === 2015-12-16 11:59:27,786 [1-26] INFO  SQLDriver - [builtinApplication.null, builtinApplication.null] Executing SQL query on 'Oracle' using connection '[B]1713494657[/B]': SELECT COUNT(*) FROM supplyItem WHERE (supplyItem.itemID=3343)
    === 2015-12-16 11:59:27,789 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] JDBC driver windowed select rows 0->-1, result size 1. Query: SELECT supplyItem.itemID, supplyItem.itemName, supplyItem.SKU, supplyItem.description, supplyItem.category, supplyItem.units, supplyItem.unitCost, supplyItem.inStock, supplyItem.nextShipment FROM supplyItem WHERE (supplyItem.itemID=3343)
    === 2015-12-16 11:59:27,820 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Using paging strategy 'jdbcScroll' - scrolling to absolute position 1
    === 2015-12-16 11:59:27,823 [1-26] DEBUG SQLDataSource - [builtinApplication.null, builtinApplication.null] Scrolling / positioning took 3ms
    [B]=== 2015-12-16 11:59:27,878 [1-26] INFO  DSResponse - [builtinApplication.null] DSResponse: List with 1 items[/B]
    === 2015-12-16 11:59:27,879 [1-26] DEBUG DSRequest - [builtinApplication.null] About to free up resources for request of type fetch on DataSource supplyItem
    === 2015-12-16 11:59:27,879 [1-26] DEBUG DSRequest - [builtinApplication.null] Ignoring freeResources call because this is not a primary request!
    === 2015-12-16 11:59:27,879 [1-26] DEBUG DSRequest - [builtinApplication.null] Ignoring freeQueueResources call because this is not a primary request!
    === 2015-12-16 11:59:27,879 [1-26] INFO  DSResponse - DSResponse: List with 1 items
    === 2015-12-16 11:59:27,879 [1-26] DEBUG DSRequest - About to free up resources for request of type add on DataSource supplyItem
    === 2015-12-16 11:59:27,879 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:27,880 [1-26] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1713494657 for SQLDriver instance 665598422
    === 2015-12-16 11:59:27,880 [1-26] DEBUG SQLConnectionManager - About to close connection with hashcode "1713494657"
    === 2015-12-16 11:59:27,880 [1-26] DEBUG PoolableSQLConnectionFactory - Executing pingTest 'select 1 from dual' on connection 1713494657
    === 2015-12-16 11:59:27,881 [1-26] DEBUG PoolableSQLConnectionFactory - Passivating connection '1713494657
    === 2015-12-16 11:59:27,882 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:27,882 [1-26] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 10
    === 2015-12-16 11:59:27,882 [1-26] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 10 of type 'supplyItem'
    === 2015-12-16 11:59:27,883 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'sequence'
    === 2015-12-16 11:59:27,885 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'sequence' but null was returned
    === 2015-12-16 11:59:27,885 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'sequence' in the pooling flow
    === 2015-12-16 11:59:27,885 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'text'
    === 2015-12-16 11:59:27,885 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'text' but null was returned
    === 2015-12-16 11:59:27,885 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'text' in the pooling flow
    === 2015-12-16 11:59:27,886 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'text'
    === 2015-12-16 11:59:27,886 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'text' but null was returned
    === 2015-12-16 11:59:27,886 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'text' in the pooling flow
    === 2015-12-16 11:59:27,886 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'text'
    === 2015-12-16 11:59:27,886 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'text' but null was returned
    === 2015-12-16 11:59:27,886 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'text' in the pooling flow
    === 2015-12-16 11:59:27,886 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'text'
    === 2015-12-16 11:59:27,887 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'text' but null was returned
    === 2015-12-16 11:59:27,887 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'text' in the pooling flow
    === 2015-12-16 11:59:27,887 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'enum'
    === 2015-12-16 11:59:27,887 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'enum' but null was returned
    === 2015-12-16 11:59:27,887 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'enum' in the pooling flow
    === 2015-12-16 11:59:27,888 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'float'
    === 2015-12-16 11:59:27,888 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'float' but null was returned
    === 2015-12-16 11:59:27,888 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'float' in the pooling flow
    === 2015-12-16 11:59:27,888 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'boolean'
    === 2015-12-16 11:59:27,889 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'boolean' but null was returned
    === 2015-12-16 11:59:27,889 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'boolean' in the pooling flow
    === 2015-12-16 11:59:27,889 [1-26] DEBUG ISCKeyedObjectPool - Borrowing object for 'date'
    === 2015-12-16 11:59:27,889 [1-26] DEBUG PoolableDataSourceFactory - Tried to create DataSource  of type 'date' but null was returned
    === 2015-12-16 11:59:27,889 [1-26] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'date' in the pooling flow
    [B]=== 2015-12-16 11:59:27,890 [1-26] WARN  SQLDataSource - New ID extracted from response: 3343[/B]
    As you can see, if you use DSTransaction, the use of different transaction for add-request and cacheSyncOperation leads to an error.

    Best regards
    Blama


    PS: Is the way I'm using dst.complete() here correct?

    #2
    Hi Isomorphic,

    in case you were wondering about the use case. In my application, after the successful import of the master data (shown), I want to create detail records referencing the parent. This all should be atomic, so I need transactions.
    This import is going to be a mail-import servlet getting called by a cron job, so there will be no RPCManager. This is why the testcase is a servlet.

    Best regards
    Blama
    Last edited by Blama; 16 Dec 2015, 08:36.

    Comment


      #3
      Thank you for describing the issue in details. This is fixed now and will be available in 10.1p nightly builds from Dec 21.

      PS. nothing wrong with the way you're using dst.compete()

      Comment


        #4
        Hi Isomorphic,

        this is fixed for me, thank you.

        Best regards
        Blama

        Comment

        Working...
        X