No announcement yet.
  • 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.


    [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] Cannot insert the value NULL into column 'Object_ID', table 'DB.Object'; column does not allow nulls. INSERT fails.
    [INFO] at
    [INFO] at
    [INFO] at
    [INFO] at$PrepStmtExecCmd.doExecute(
    [INFO] at
    [INFO] at
    [INFO] at
    [INFO] at
    [INFO] at
    [INFO] at com.isomorphic.sql.SQLDriver.doUpdate(
    [INFO] at com.isomorphic.sql.SQLDriver.update(
    [INFO] at com.isomorphic.sql.SQLDriver.executeUpdate(
    [INFO] at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(
    [INFO] at com.isomorphic.sql.SQLDataSource.SQLExecute(
    [INFO] at com.isomorphic.sql.SQLDataSource.processRequest(
    [INFO] at com.isomorphic.sql.SQLDataSource.executeAdd(
    [INFO] at com.bp2s.xproducts.cof.server.customDataSource.XPDataSource.executeAdd(
    [INFO] at com.isomorphic.datasource.DataSource.execute(
    [INFO] at com.isomorphic.application.AppBase.executeDefaultDSOperation(
    [INFO] at com.isomorphic.application.AppBase.executeAppOperation(
    [INFO] at com.isomorphic.application.AppBase.execute(
    [INFO] at com.isomorphic.datasource.DSRequest.execute(
    [INFO] at com.bp2s.xproducts.cof.server.datasource.dmi.DMIUpdaterCreator.add(
    [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(
    [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    [INFO] at java.lang.reflect.Method.invoke(
    [INFO] at com.isomorphic.base.Reflection._invokeMethod(
    [INFO] at com.isomorphic.base.Reflection.adaptArgsAndInvoke(
    [INFO] at com.isomorphic.datasource.DataSourceDMI.execute(
    [INFO] at com.isomorphic.datasource.DataSourceDMI.execute(
    [INFO] at com.isomorphic.datasource.DSRequest.execute(
    [INFO] at com.isomorphic.servlet.IDACall.handleDSRequest(
    [INFO] at com.isomorphic.servlet.IDACall.processRPCTransaction(
    [INFO] at com.bp2s.xproducts.cof.server.servlet.SecureIDACall.processRequest(
    [INFO] at com.isomorphic.servlet.IDACall._processRequest(
    [INFO] at com.isomorphic.servlet.IDACall.doPost(
    [INFO] at javax.servlet.http.HttpServlet.service(
    [INFO] at com.isomorphic.servlet.BaseServlet.service(
    [INFO] at javax.servlet.http.HttpServlet.service(
    [INFO] at org.eclipse.jetty.servlet.ServletHolder.handle(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    [INFO] at com.bp2s.xproducts.cof.server.filter.SessionWatchFilter.doFilter(
    [INFO] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(
    [INFO] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    [INFO] at
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    [INFO] at com.bp2s.xproducts.cof.server.filter.IDACallFilter.doFilter(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    [INFO] at com.bp2s.xproducts.cof.server.filter.GWTCacheControlFilter.doFilter(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler.doHandle(
    [INFO] at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    [INFO] at
    [INFO] at org.eclipse.jetty.server.session.SessionHandler.doHandle(
    [INFO] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
    [INFO] at org.eclipse.jetty.servlet.ServletHandler.doScope(
    [INFO] at org.eclipse.jetty.server.session.SessionHandler.doScope(
    [INFO] at org.eclipse.jetty.server.handler.ContextHandler.doScope(
    [INFO] at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    [INFO] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
    [INFO] at org.eclipse.jetty.server.handler.RequestLogHandler.handle(
    [INFO] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
    [INFO] at org.eclipse.jetty.server.Server.handle(
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection.content(
    [INFO] at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
    [INFO] at org.eclipse.jetty.http.HttpParser.parseNext(
    [INFO] at org.eclipse.jetty.http.HttpParser.parseAvailable(
    [INFO] at org.eclipse.jetty.server.AsyncHttpConnection.handle(
    [INFO] at
    [INFO] at$
    [INFO] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
    [INFO] at org.eclipse.jetty.util.thread.QueuedThreadPool$
    [INFO] at
    [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"> -> 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).

    <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>


    addButton.addClickHandler(new ClickHandler() {

    public void onClick(ClickEvent event) {


    Please guide me on the above two issues.

    Attached Files

    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


      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.




        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.