Announcement

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

    PK is not generated for Add opeartion and we see icons in the ListGridField

    Hi Isomorphic,

    We are using smartGWT version of 6.1-p20200816 with GWT as 2.7.
    we started to build new application where we got stuck with 2 issues.

    Issue-1: PK is not getting generated for Add operation.

    We do an add operation the PK is not generated and we end up with the below error.

    Log:

    [INFO] === 2020-11-12 11:52:39,120 [0-96] INFO DSRequest - Executing Object.add
    [INFO] === 2020-11-12 11:52:39,121 [0-96] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    [INFO] === 2020-11-12 11:52:39,121 [0-96] DEBUG DeclarativeSecurity - DataSource Object is not in the pre-checked list, processing...
    [INFO] === 2020-11-12 11:52:39,121 [0-96] DEBUG AppBase - [builtinApplication.Object_add] No userTypes defined, allowing anyone access to all operations for this application
    [INFO] === 2020-11-12 11:52:39,121 [0-96] DEBUG AppBase - [builtinApplication.Object_add] No public zero-argument method named '_Object_add' found, performing generic datasource operation
    [INFO] === 2020-11-12 11:52:39,745 [0-96] INFO SQLDataSource - [builtinApplication.Object_add] Performing add operation with
    [INFO] criteria: {Object_NAME:"Object 1"} values: {Object_NAME:"Object 1",Object_UPDATEDATE:"2020-11-12 11:52:39.12",Object_UPDATEUSER:"DUMMY",Object_CREATEDATE:"2020-11-12 11:52:39.12",Object_CREATEUSER:"DUMMY"}
    [INFO] === 2020-11-12 11:52:39,747 [0-96] DEBUG SQLValuesClause - [builtinApplication.Object_add] Sequences: {Object_ID=__default}
    [INFO] === 2020-11-12 11:52:39,772 [0-96] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Object_add] makeObject() created an unpooled Connection '17746223'
    [INFO] === 2020-11-12 11:52:39,772 [0-96] DEBUG SQLConnectionManager - [builtinApplication.Object_add] Borrowed connection '17746223'
    [INFO] === 2020-11-12 11:52:39,773 [0-96] DEBUG SQLTransaction - [builtinApplication.Object_add] Started new DB transaction "'17746223'"
    [INFO] === 2020-11-12 11:52:39,774 [0-96] DEBUG SQLDataSource - [builtinApplication.Object_add] Setting DSRequest as being part of a transaction
    [INFO] === 2020-11-12 11:52:39,774 [0-96] INFO SQLDriver - [builtinApplication.Object_add] Executing SQL query on 'DB' using connection '1774646223': INSERT INTO Object (Object_CREATEDATE, Object_CREATEUSER, Object_NAME, Object_UPDATEDATE,Object_UPDATEUSER) VALUES ('2020-11-12 11:52:39.12', 'DUMMY', 'Object 1', '2020-11-12 11:52:39.12', 'DUMMY')
    [INFO] === 2020-11-12 11:52:39,776 [0-96] DEBUG SQLDriver - [builtinApplication.Object_add] Found 1 sequence(s)/autoGenerated PK field(s): [Object_ID]
    [INFO] === 2020-11-12 11:52:39,776 [0-96] WARN SQLDriver - [builtinApplication.Object_add] getGeneratedKeys: there was a row in the metadata resultset, but it contained a null value for the generated key field 'Object_ID'
    [INFO] === 2020-11-12 11:52:39,777 [0-96] DEBUG SQLDriver - [builtinApplication.Object_add] FAILED to execute SQL update in 'DB' using '17746223'
    [INFO] 2020/11/12 11:52:39:777 ERROR [qtp503425070-96] XPDataSource (line 167) - Cannot insert the value NULL into column 'Object_ID', table 'DB.Object'; column does not allow nulls. INSERT fails.
    [INFO] com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'Object_ID', table 'DB.Object'; column does not allow nulls. INSERT fails.
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
    [INFO] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
    [INFO] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
    [INFO] at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:1302)
    [INFO] at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:1202)
    [INFO] at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1388)
    [INFO] at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:597)
    [INFO] at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1847)
    [INFO] at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:439)
    [INFO] at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:392)
    [INFO] at com.bp2s.xproducts.cof.server.customDataSource.XPDataSource.executeAdd(XPDataSource.java:157)
    [INFO] at com.isomorphic.datasource.DataSource.execute(DataSource.java:2307)
    [INFO] at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:638)
    [INFO] at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:548)
    [INFO] at com.isomorphic.application.AppBase.execute(AppBase.java:491)
    [INFO] at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2829)
    [INFO] at com.bp2s.xproducts.cof.server.datasource.dmi.DMIUpdaterCreator.add(DMIUpdaterCreator.java:119)
    [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [INFO] at java.lang.reflect.Method.invoke(Method.java:606)
    [INFO] at com.isomorphic.base.Reflection._invokeMethod(Reflection.java:580)
    [INFO] at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:895)
    [INFO] at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:434)
    [INFO] at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
    [INFO] at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2825)
    [INFO] at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:226)
    [INFO] at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:183)
    [INFO] at com.bp2s.xproducts.cof.server.servlet.SecureIDACall.processRequest(SecureIDACall.java:41)
    [INFO] at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
    [INFO] at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
    [INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    [INFO] at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:176)
    [INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    [INFO] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    [INFO] at com.bp2s.xproducts.cof.server.filter.SessionWatchFilter.doFilter(SessionWatchFilter.java:64)
    [INFO] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    [INFO] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    [INFO] at com.bnpparibas.sso.http.filter.SSOFilter.doFilter(SSOFilter.java:229)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    [INFO] at com.bp2s.xproducts.cof.server.filter.IDACallFilter.doFilter(IDACallFilter.java:125)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    [INFO] at com.bp2s.xproducts.cof.server.filter.GWTCacheControlFilter.doFilter(GWTCacheControlFilter.java:68)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    [INFO] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    [INFO] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    [INFO] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    [INFO] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    [INFO] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    [INFO] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    [INFO] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    [INFO] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    [INFO] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    [INFO] at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    [INFO] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    [INFO] at org.eclipse.jetty.server.Server.handle(Server.java:370)
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    [INFO] at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    [INFO] at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    [INFO] at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    [INFO] at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    [INFO] at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    [INFO] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    [INFO] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    [INFO] at java.lang.Thread.run(Thread.java:744)
    [INFO] === 2020-11-12 11:52:39,778 [0-96] DEBUG DSRequest - freeOnExecute is false for request of type add on DataSource Object - not freeing resources!


    we have specified type and primaryKey for the field of the table and configured sequence mode like below,

    ds.xml -> <field name="ID" type="sequence" hidden="true" primaryKey="true">
    Server.properties -> sql.sqlserver.default.sequence.mode: jdbcDriver

    Please let us know if we are missing out something.

    Issue-2: Icons added in listGridField.

    In the UI, for the toolstrip we have used a (+) button for adding an record into listgrid.
    When we click on it, it will call startEditingNew() method to create new record in the grid, but it is having icon based on the field type we defined in ds.xml file. This is not the case we used to earlier. we are facing this issue as a new one.
    Attaching the screenshot of the issue (SC-1).


    Ds.xml:
    <fields>
    <field name="Object _ID" type="sequence" hidden="true" primaryKey="true"></field>
    <field name="Object_NAME" type="text" length="256"></field>
    <field name="Object_UPDATEDATE" type="datetime"></field>
    <field name="Object_UPDATEUSER" type="text" length="256"></field>
    <field name="Object_CREATEDATE" type="datetime"></field>
    <field name="Object_CREATEUSER" type="text" length="256"></field>
    </fields>

    Code:

    addButton.addClickHandler(new ClickHandler() {

    public void onClick(ClickEvent event) {
    grid.startEditingNew();

    }
    });



    Please guide me on the above two issues.


    Thanks,
    Manjula
    Attached Files

    #2
    1. that error is being thrown by your JDBC database driver, not by us. Presumably this is a SQL table you created by hand, not one we generated (as a table we generated would have worked), and something is wrong with the table definition: perhaps you used a style of sequence we're not familiar with. We can't help without knowing the SQL used to create the table, but do look at DataSourceField autoGenerated, sequenceName, implicitSequence and other linked properties to understand all the different kinds of sequence that exist and that we support

    2. because the length is over 255 (happens to be 256), the listGrid.longTextEditorType is being used, which includes an icon when editing

    Comment


      #3
      Hi Isomorphic,

      Thanks for your reply.
      Issue-1: It is a fault on DB side. we fixed it now.
      Issue-2: Thanks for pointing it out. I have changed the length value to 255, now it is good.


      Thanks,
      Manjula

      Comment


        #4
        Great!

        On #2, note that if you want to keep the fields at 256, you can just set longTextEditorThreshold - you could change the default setting (for both ListGrid and DynamicForm) to be higher.

        Comment

        Working...
        X