Announcement

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

    AutoDeriveSchema bug ?

    I am trying to finally change my datasources to autoDeriveSchema="true" but I now have another problem and I think it is a bug.

    Entrypoint:
    Code:
    public void onModuleLoad() {
    
            final VLayout vlayout = new VLayout();
            IButton button = new IButton("go!");
            button.addClickHandler(new ClickHandler() {
    
                @Override
                public void onClick(ClickEvent event) {
                    DataSource.get("test")
                    .performCustomOperation("testDMI", new Record(),
                            new DSCallback() {
    
                                @Override
                                public void execute(
                                        DSResponse dsResponse,
                                        Object data, DSRequest dsRequest) {
                                    SC.say("ok");
                                }
                            });
                }
            });
            vlayout.addMember(button);
            vlayout.draw();
            
        }
    test.ds.xml
    Code:
    <DataSource ID="test" serverType="sql" tableName="t_rel_schueler_eltern">
    
        <fields>
            <field name="f_id" type="sequence" primaryKey="true" />
        </fields>
    
        <operationBindings>
            <operationBinding operationType="custom" operationId="testDMI">
                <serverObject className="de.mks_infofabrik.kids.server.test.TestingDMI"
                    methodName="testDMI" />
            </operationBinding>
        </operationBindings>
    
    </DataSource>
    TestingDMI:
    Code:
    public class TestingDMI {
    
        public DSResponse testDMI(DSRequest dsRequest) throws Exception {
            RPCManager rpcManager = dsRequest.getRPCManager();
    
            DSRequest relAddRequest = new DSRequest("relSchuelerEltern", DataSource.OP_ADD, rpcManager);
            Map<String, Object> vals = new HashMap<>();
            vals.put("f_schueler_id", 109);
            vals.put("f_eltern_id", 8919);
            vals.put("f_mandant", 1);
            relAddRequest.setValues(vals);
            relAddRequest.execute();
    
            return new DSResponse();
        }
    }
    relSchuelerEltern.ds.xml
    Code:
    <DataSource ID="relSchuelerEltern" serverType="sql"
        tableName="t_rel_schueler_eltern" autoDeriveSchema="true" />
    Table definition (MSSQL 2014):
    Code:
    CREATE TABLE [dbo].[t_rel_schueler_eltern](
        [f_schueler_id] [int] NOT NULL,
        [f_eltern_id] [int] NOT NULL,
        [f_typ] [char](7) NOT NULL,
        [f_mandant] [tinyint] NOT NULL,
     CONSTRAINT [PK_t_rel_schueler_eltern] PRIMARY KEY CLUSTERED
    (
        [f_schueler_id] ASC,
        [f_eltern_id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    GO
    Log:
    Code:
    === 2015-12-28 14:45:00,285 [c-10] DEBUG ISCKeyedObjectPool - Borrowing object for 'DataSource'
    === 2015-12-28 14:45:00,286 [c-10] DEBUG PoolableDataSourceFactory - Created DataSource 589 of type 'DataSource' and assigned it to thread http-nio-8080-exec-10
    === 2015-12-28 14:45:00,286 [c-10] DEBUG PoolableDataSourceFactory - Created DataSource 589 of type 'DataSource' in the pooling flow
    === 2015-12-28 14:45:00,286 [c-10] DEBUG PoolableDataSourceFactory - Activated DataSource 589 of type 'DataSource'
    === 2015-12-28 14:45:00,287 [c-10] DEBUG PoolableDataSourceFactory - Created DataSource 590 of type 'List' and assigned it to thread http-nio-8080-exec-10
    === 2015-12-28 14:45:00,287 [c-10] DEBUG PoolableDataSourceFactory - Created DataSource 590 of type 'List' in the pooling flow
    === 2015-12-28 14:45:00,287 [c-10] DEBUG PoolableDataSourceFactory - Activated DataSource 590 of type 'List'
    === 2015-12-28 14:45:00,288 [c-10] DEBUG ISCKeyedObjectPool - Borrowing object for 'elem'
    === 2015-12-28 14:45:00,288 [c-10] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'elem' in the pooling flow
    === 2015-12-28 14:45:00,288 [c-10] DEBUG RPCManager - Processing 1 requests.
    === 2015-12-28 14:45:00,289 [c-10] DEBUG ISCKeyedObjectPool - Borrowing object for 'test'
    === 2015-12-28 14:45:00,289 [c-10] DEBUG PoolableDataSourceFactory - Activated DataSource 587 of type 'test'
    === 2015-12-28 14:45:00,289 [c-10] DEBUG DSRequest - Caching instance 587 of DS 'test' from DSRequest.getDataSource()
    === 2015-12-28 14:45:00,289 [c-10] DEBUG DSRequest - Caching instance 587 of DS test
    === 2015-12-28 14:45:00,289 [c-10] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        values:{
        },
        operationConfig:{
            dataSource:"test",
            repo:null,
            operationType:"custom",
            textMatchStyle:"exact"
        },
        appID:"builtinApplication",
        operation:"testDMI",
        oldValues:{
        },
        criteria:{
        }
    }
    === 2015-12-28 14:45:00,290 [c-10] INFO  IDACall - Key[type=com.isomorphic.servlet.IDACall, annotation=[none]] - Performing 1 operation(s)
    === 2015-12-28 14:45:00,290 [c-10] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2015-12-28 14:45:00,290 [c-10] DEBUG DeclarativeSecurity - DataSource test is not in the pre-checked list, processing...
    === 2015-12-28 14:45:00,295 [c-10] DEBUG ISCKeyedObjectPool - Borrowing object for 'relSchuelerEltern'
    === 2015-12-28 14:45:00,295 [c-10] DEBUG PoolableDataSourceFactory - Activated DataSource 160 of type 'relSchuelerEltern'
    === 2015-12-28 14:45:00,295 [c-10] DEBUG DSRequest - Caching instance 160 of DS 'relSchuelerEltern' from DSRequest.getDataSource()
    === 2015-12-28 14:45:00,295 [c-10] DEBUG DSRequest - Caching instance 160 of DS relSchuelerEltern
    === 2015-12-28 14:45:00,295 [c-10] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2015-12-28 14:45:00,295 [c-10] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2015-12-28 14:45:00,295 [c-10] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2015-12-28 14:45:00,296 [c-10] INFO  SQLDataSource - [builtinApplication.null] Performing add operation with
        criteria: {f_eltern_id:8919,f_mandant:1,f_schueler_id:109}    values: {f_eltern_id:8919,f_mandant:1,f_schueler_id:109}
    === 2015-12-28 14:45:00,298 [c-10] DEBUG SQLValuesClause - [builtinApplication.null] Sequences: {f_eltern_id=__default, f_schueler_id=__default}
    === 2015-12-28 14:45:00,301 [c-10] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '105478891'
    === 2015-12-28 14:45:00,302 [c-10] DEBUG SQLTransaction - [builtinApplication.null] Started new SQLSERVER transaction "105478891"
    === 2015-12-28 14:45:00,302 [c-10] DEBUG SQLDriver - [builtinApplication.null] About to execute SQL update in 'SQLSERVER' using connection'105478891'
    === 2015-12-28 14:45:00,302 [c-10] INFO  SQLDriver - [builtinApplication.null] Executing SQL update on 'SQLSERVER': INSERT INTO t_rel_schueler_eltern (f_mandant) VALUES (1)
    === 2015-12-28 14:45:00,309 [c-10] DEBUG SQLDriver - [builtinApplication.null] Found 2 sequence(s)/autoGenerated PK field(s): [f_schueler_id, f_eltern_id]
    === 2015-12-28 14:45:00,309 [c-10] DEBUG SQLDriver - [builtinApplication.null] Discovered zero or more generated key(s) via JDBC: {}
    === 2015-12-28 14:45:00,311 [c-10] DEBUG SQLDriver - [builtinApplication.null] FAILED to execute SQL update in 'SQLSERVER' using connection'105478891'
    === 2015-12-28 14:45:00,311 [c-10] DEBUG DSRequest - freeOnExecute is false for request of type add on DataSource relSchuelerEltern - not freeing resources!
    === 2015-12-28 14:45:00,311 [c-10] DEBUG DataSourceDMI - Invocation threw exception
    com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'f_schueler_id', table 'kids.dbo.t_rel_schueler_eltern'; column does not allow nulls. INSERT fails.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:902)
        at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:804)
        at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:989)
        at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:579)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2013)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:452)
        at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:405)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:1950)
        at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726)
        at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
        at com.isomorphic.application.AppBase.execute(AppBase.java:491)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2548)
        at de.mks_infofabrik.kids.server.test.TestingDMI.testDMI(TestingDMI.java:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:975)
        at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:416)
        at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2544)
        at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220)
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
        at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at de.mks_infofabrik.kids.server.filter.GWTCacheControlFilter.doFilter(GWTCacheControlFilter.java:50)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
    === 2015-12-28 14:45:00,313 [c-10] DEBUG DSRequest - About to free up resources for request of type custom on DataSource test
    === 2015-12-28 14:45:00,313 [c-10] DEBUG DSRequest - Ignoring freeResources call because this is not a primary request!
    === 2015-12-28 14:45:00,314 [c-10] WARN  RequestContext - dsRequest.execute() failed:
    com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'f_schueler_id', table 'kids.dbo.t_rel_schueler_eltern'; column does not allow nulls. INSERT fails.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:902)
        at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:804)
        at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:989)
        at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:579)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2013)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:452)
        at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:405)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:1950)
        at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726)
        at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
        at com.isomorphic.application.AppBase.execute(AppBase.java:491)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2548)
        at de.mks_infofabrik.kids.server.test.TestingDMI.testDMI(TestingDMI.java:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:975)
        at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:416)
        at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2544)
        at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:220)
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:185)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
        at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:117)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at de.mks_infofabrik.kids.server.filter.GWTCacheControlFilter.doFilter(GWTCacheControlFilter.java:50)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
    === 2015-12-28 14:45:00,314 [c-10] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2015-12-28 14:45:00,315 [c-10] DEBUG SQLTransaction - Rolling back SQLSERVER transaction "105478891"
    === 2015-12-28 14:45:00,315 [c-10] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2015-12-28 14:45:00,317 [c-10] DEBUG DSRequest - Ignoring freeQueueResources call because this is not a primary request!
    === 2015-12-28 14:45:00,317 [c-10] DEBUG SQLTransaction - getConnection() found transactional connection for SQLSERVER with hashcode "105478891"
    === 2015-12-28 14:45:00,317 [c-10] DEBUG SQLTransaction - Ending SQLSERVER transaction "105478891"
    === 2015-12-28 14:45:00,317 [c-10] DEBUG SQLConnectionManager - About to close connection with hashcode "105478891"
    === 2015-12-28 14:45:00,317 [c-10] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 587 of type 'test'
    === 2015-12-28 14:45:00,317 [c-10] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 160 of type 'relSchuelerEltern'
    === 2015-12-28 14:45:00,318 [c-10] INFO  Compression - /kids-dev/V010402SNAPSHOT/sc/IDACall: 276 -> 220 bytes
    As you see, in my table t_rel_schueler_eltern I have a composite primary key: (f_schueler_id, f_eltern_id). This seems not to work.
    The other fields are being correctly autoDerived, but this composite primary key not.

    Using smartgwt 5.0p power 2015-09-20 and MSSQL 2014.


    #2
    If I change my datasource to not use autoDeriveSchema, everything works. So it seems to have a problem with composite primary keys.

    Example where everything works:
    Code:
    <DataSource ID="relSchuelerEltern" serverType="sql"
        tableName="t_rel_schueler_eltern">
        <fields>
            <field name="f_schueler_id" type="integer" primaryKey="true" />
            <field name="f_eltern_id" type="integer" primaryKey="true" />
            <field name="f_mandant" type="integer" />
            <field name="f_typ" type="text" />
        </fields>
    
    </DataSource>

    Comment


      #3
      It looks like we're detecting the PK as a pair of sequences instead of as ordinary integer fields. This may be either a bug, or a limitation of the amount or correctness of information that SQL Server's JDBC driver is providing.

      You might get better behavior with a more recent JDBC driver if one is available.

      If that doesn't help, you can still partially use autoDeriveSchema, by just declaring the PK fields and leaving the others implicit - we'd expect that to work.

      Finally, in terms of investigating this, can you show a log for when an insert works correctly (with autoDeriveSchema off)?

      Comment


        #4
        Hi Isomorphic,

        the logs when an insert works correctly (autoDeriveSchema=off):
        Code:
        === 2015-12-29 11:46:20,662 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 602 of type 'DataSource' in the pooling flow
        === 2015-12-29 11:46:20,662 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 602 of type 'DataSource'
        === 2015-12-29 11:46:20,663 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 603 of type 'List' and assigned it to thread http-nio-8080-exec-7
        === 2015-12-29 11:46:20,663 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 603 of type 'List' in the pooling flow
        === 2015-12-29 11:46:20,663 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 603 of type 'List'
        === 2015-12-29 11:46:20,663 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'elem'
        === 2015-12-29 11:46:20,663 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'elem' in the pooling flow
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG RPCManager - Processing 1 requests.
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'test'
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 587 of type 'test'
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG DSRequest - Caching instance 587 of DS 'test' from DSRequest.getDataSource()
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG DSRequest - Caching instance 587 of DS test
        === 2015-12-29 11:46:20,664 [ec-7] DEBUG RPCManager - Request #1 (DSRequest) payload: {
            values:{
            },
            operationConfig:{
                dataSource:"test",
                repo:null,
                operationType:"custom",
                textMatchStyle:"exact"
            },
            appID:"builtinApplication",
            operation:"testDMI",
            oldValues:{
            },
            criteria:{
            }
        }
        === 2015-12-29 11:46:20,664 [ec-7] INFO  IDACall - Key[type=com.isomorphic.servlet.IDACall, annotation=[none]] - Performing 1 operation(s)
        === 2015-12-29 11:46:20,665 [ec-7] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
        === 2015-12-29 11:46:20,665 [ec-7] DEBUG DeclarativeSecurity - DataSource test is not in the pre-checked list, processing...
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'relSchuelerEltern'
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 160 of type 'relSchuelerEltern'
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG DSRequest - Caching instance 160 of DS 'relSchuelerEltern' from DSRequest.getDataSource()
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG DSRequest - Caching instance 160 of DS relSchuelerEltern
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
        === 2015-12-29 11:46:20,668 [ec-7] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
        === 2015-12-29 11:46:20,669 [ec-7] INFO  SQLDataSource - [builtinApplication.null] Performing add operation with
            criteria: {f_eltern_id:8919,f_mandant:1,f_schueler_id:109}    values: {f_eltern_id:8919,f_mandant:1,f_schueler_id:109}
        === 2015-12-29 11:46:20,670 [ec-7] DEBUG SQLValuesClause - [builtinApplication.null] Sequences: {}
        === 2015-12-29 11:46:20,673 [ec-7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] Passing JDBC URL only to getConnection
        === 2015-12-29 11:46:21,022 [ec-7] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] makeObject() created a pooled Connection '839955475'
        === 2015-12-29 11:46:21,022 [ec-7] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '839955475'
        === 2015-12-29 11:46:21,022 [ec-7] DEBUG SQLTransaction - [builtinApplication.null] Started new SQLSERVER transaction "839955475"
        === 2015-12-29 11:46:21,022 [ec-7] DEBUG SQLDriver - [builtinApplication.null] About to execute SQL update in 'SQLSERVER' using connection'839955475'
        === 2015-12-29 11:46:21,022 [ec-7] INFO  SQLDriver - [builtinApplication.null] Executing SQL update on 'SQLSERVER': INSERT INTO t_rel_schueler_eltern (f_eltern_id, f_mandant, f_schueler_id) VALUES (8919, 1, 109)
        === 2015-12-29 11:46:21,035 [ec-7] DEBUG SQLDriver - [builtinApplication.null] DataSource relSchuelerEltern has no sequence fields and no primaryKeys where 'autoGenerated' is true.  Skipping search for generated values
        === 2015-12-29 11:46:21,036 [ec-7] DEBUG SQLDataSource - [builtinApplication.null] add operation affected 1 rows
        === 2015-12-29 11:46:21,037 [ec-7] INFO  SQLDataSource - [builtinApplication.null] primaryKeys: {f_eltern_id=8919, f_schueler_id=109}
        === 2015-12-29 11:46:21,037 [ec-7] DEBUG DeclarativeSecurity - [builtinApplication.null] Processing security checks for DataSource null, field null
        === 2015-12-29 11:46:21,037 [ec-7] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
        === 2015-12-29 11:46:21,037 [ec-7] DEBUG AppBase - [builtinApplication.null, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
        === 2015-12-29 11:46:21,038 [ec-7] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] Performing fetch operation with
            criteria: {f_eltern_id:8919,f_schueler_id:109}    values: {f_eltern_id:8919,f_schueler_id:109}
        === 2015-12-29 11:46:21,038 [ec-7] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
        === 2015-12-29 11:46:21,038 [ec-7] INFO  SQLDataSource - [builtinApplication.null, builtinApplication.null] 160: Executing SQL query on 'SQLSERVER': SELECT t_rel_schueler_eltern.f_schueler_id, t_rel_schueler_eltern.f_eltern_id, t_rel_schueler_eltern.f_mandant, t_rel_schueler_eltern.f_typ FROM t_rel_schueler_eltern WHERE (t_rel_schueler_eltern.f_eltern_id=8919 AND t_rel_schueler_eltern.f_schueler_id=109)
        === 2015-12-29 11:46:21,038 [ec-7] DEBUG SQLDriver - [builtinApplication.null, builtinApplication.null] About to execute SQL query in 'SQLSERVER' using connection '839955475'
        === 2015-12-29 11:46:21,038 [ec-7] INFO  SQLDriver - [builtinApplication.null, builtinApplication.null] Executing SQL query on 'SQLSERVER': SELECT t_rel_schueler_eltern.f_schueler_id, t_rel_schueler_eltern.f_eltern_id, t_rel_schueler_eltern.f_mandant, t_rel_schueler_eltern.f_typ FROM t_rel_schueler_eltern WHERE (t_rel_schueler_eltern.f_eltern_id=8919 AND t_rel_schueler_eltern.f_schueler_id=109)
        === 2015-12-29 11:46:21,048 [ec-7] INFO  DSResponse - [builtinApplication.null, builtinApplication.null] DSResponse: List with 1 items
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG DSRequest - [builtinApplication.null] freeOnExecute is false for request of type fetch on DataSource relSchuelerEltern - not freeing resources!
        === 2015-12-29 11:46:21,048 [ec-7] INFO  DSResponse - [builtinApplication.null] DSResponse: List with 1 items
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG DSRequest - freeOnExecute is false for request of type add on DataSource relSchuelerEltern - not freeing resources!
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG DSRequest - About to free up resources for request of type custom on DataSource test
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG DSRequest - Ignoring freeResources call because this is not a primary request!
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
        === 2015-12-29 11:46:21,048 [ec-7] DEBUG SQLTransaction - Committing SQLSERVER transaction "839955475"
        === 2015-12-29 11:46:21,049 [ec-7] DEBUG RPCManager - DMI response, dropExtraFields: false
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG DSRequest - Ignoring freeQueueResources call because this is not a primary request!
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG SQLTransaction - getConnection() found transactional connection for SQLSERVER with hashcode "839955475"
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG SQLTransaction - Ending SQLSERVER transaction "839955475"
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG SQLConnectionManager - About to close connection with hashcode "839955475"
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 587 of type 'test'
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 160 of type 'relSchuelerEltern'
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG DSRequest - Ignoring freeResources call because this is not a primary request!
        === 2015-12-29 11:46:21,051 [ec-7] DEBUG DSRequest - Ignoring freeQueueResources call because this is not a primary request!
        === 2015-12-29 11:46:21,051 [ec-7] INFO  Compression - /kids-dev/V010402SNAPSHOT/sc/IDACall: 159 -> 142 bytes
        === 2015-12-29 11:46:21,167 [ec-3] INFO  RequestContext - URL: '/kids-dev/V010402SNAPSHOT/sc/skins/EnterpriseBlue/images/Dialog/say.png', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36': Safari with Accept-Encoding header
        === 2015-12-29 11:46:21,168 [ec-3] INFO  Download - done streaming: /Users/eduardo/Documents/git/kids/kids/target/kids-1.4.2-SNAPSHOT/V010402SNAPSHOT/sc/skins/EnterpriseBlue/images/Dialog/say.png
        I am using the MSSQL sqljdbc4.jar driver.

        Comment


          #5
          I replaced the Driver with the 4.2 version (the newest) and I get the same error when autoDeriveSchema=true

          Comment


            #6
            Edit: Using Using smartgwt 5.0p power 2015-09-19 (in both cases).

            Comment


              #7
              FYI this is fixed now and will be available in nightly builds since Jan 12.

              Comment

              Working...
              X