(Solved) databaseManager.saveData did'nt works in Web Client

Hello Everybody and Happy New Year.

I’ve got problems with v.5.0.1, and I don’t know how to solve it.

I’ve just to migrate my solution from v.4.1.4 to v.5.0.1 and something works wrong with Web Client.
When I do databaseManager.saveData(), only the id, and fields with AutoEnter (Custom values) are saved. On the other hand, the same solution in Rich client works perfect!!!, and this solution in v.4.1.4 works right both in Web and Rich Client.

Have I doing anything wrong?

Best regards. Roberto.

P.D.
I’ve tested it in Windows7 and Ubuntu, with oracle express, postgresql and mysql with the same result.

Roberto,

Can you reproduce this is an small sample solution?

Rob

This is a small piece of code.

Best Regards. Roberto.

ERP.servoy (7.28 KB)

Roberto,

Please create a case in our support system with the sample attached.

http://www.servoy.com/s

Rob

I did it.

Thanks a lot.

Roberto Blasco:
I did it.

Thanks a lot.

Can you please provide some steps to reproduce the issue, the sample seems to work well ?

My fail!!!

I didn’t check ddbb permissions.

¿How can I close the case?

Thanks a lot.
Best Regards, Roberto.

False success, :-( .

I tried it in 4.1.4, when I did it again with 5.0.1 the solution crashed saving data.

this’s the log error

2010-01-07 23:58 	http-8501-5 	ERROR 	com.servoy.j2db.util.Debug 	Throwable
com.servoy.j2db.ApplicationException: Cannot save form data
     at com.servoy.j2db.dataprocessing.EditRecordList.stopEditing(EditRecordList.java:304)
     at com.servoy.j2db.dataprocessing.EditRecordList.stopEditing(EditRecordList.java:580)
     at com.servoy.j2db.dataprocessing.JSDatabaseManager.js_saveData(JSDatabaseManager.java:298)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
     at com.servoy.j2db.scripting.Zsb.executeFunction(Zsb.java:74)
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:116)
     at com.servoy.j2db.Zpb.Za(Zpb.java:1007)
     at com.servoy.j2db.Zpb.Za(Zpb.java:273)
     at com.servoy.j2db.Zvb.Za(Zvb.java:8)
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:54)
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:33)
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:13)
     at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:209)
     at com.servoy.j2db.server.headlessclient.dataui.Zjd.onEvent(Zjd.java:1)
     at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
     at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
     at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:113)
     at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
     at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468)
     at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
     at java.lang.Thread.run(Thread.java:595)
    Caused by: com.servoy.j2db.dataprocessing.DataException: ERROR: el valor null para la columna «nombre_idioma» viola la restricción not null
     at com.servoy.j2db.dblayer.Zb.Za(Zb.java:59)
     at com.servoy.j2db.persistence.Server.translateSQLException(Server.java:115)
     at com.servoy.j2db.dataprocessing.SQLEngine.performUpdates(SQLEngine.java:768)
     at com.servoy.j2db.dataprocessing.EditRecordList.stopEditing(EditRecordList.java:493)
     ... 49 more
2010-01-07 23:58 	http-8501-5 	ERROR 	com.servoy.j2db.util.Debug 	save failed for 1 or more records
2010-01-07 23:58 	http-8501-5 	ERROR 	com.servoy.j2db.util.Debug 	Error executing sql: insert into t_dgen_idiomas (cod_idioma, nombre_idioma) values (?, ?) with params: [2 ,type: java.lang.Long, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue]
org.postgresql.util.PSQLException: ERROR: el valor null para la columna «nombre_idioma» viola la restricción not null
     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
     at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
     at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at com.servoy.j2db.persistence.datasource.Zf.invoke(Zf.java:8)
     at $Proxy1.executeUpdate(Unknown Source)
     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
     at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:207)
     at com.servoy.j2db.dataprocessing.SQLEngine.performUpdates(SQLEngine.java:297)
     at com.servoy.j2db.dataprocessing.EditRecordList.stopEditing(EditRecordList.java:493)
     at com.servoy.j2db.dataprocessing.EditRecordList.stopEditing(EditRecordList.java:580)
     at com.servoy.j2db.dataprocessing.JSDatabaseManager.js_saveData(JSDatabaseManager.java:298)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
     at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
     at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
     at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
     at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
     at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
     at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
     at com.servoy.j2db.scripting.Zsb.executeFunction(Zsb.java:74)
     at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:116)
     at com.servoy.j2db.Zpb.Za(Zpb.java:1007)
     at com.servoy.j2db.Zpb.Za(Zpb.java:273)
     at com.servoy.j2db.Zvb.Za(Zvb.java:8)
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:54)
     at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:33)
     at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:13)
     at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:209)
     at com.servoy.j2db.server.headlessclient.dataui.Zjd.onEvent(Zjd.java:1)
     at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
     at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
     at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:113)
     at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
     at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468)
     at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
     at java.lang.Thread.run(Thread.java:595)

and this’s the console output…

save failed for 1 or more records
 > com.servoy.j2db.dataprocessing.DataException: ERROR: el valor null para la columna «nombre_idioma» viola la restricción not null

Best regards. Roberto.

I tested your solution, you’re right there’s a problem in webclient.

What is really strange, just put your idioma form in you tabpanel designing your form and expected behaviour seems to be correct

so you have an exception that a column is null that you try to insert but in the smart client thats not the case?
Where should that column be filled?

so you have an exception that a column is null that you try to insert but in the smart client thats not the case?

Exactly.

Where should that column be filled?

The column must be filled by typing the value.
However, if the field is filled through an Auto Enter value, or a Value List, or a calendar, or something given by Servoy, the data is saved. Why?

Best regards. Roberto.

Roberto Blasco:

so you have an exception that a column is null that you try to insert but in the smart client thats not the case?

Exactly.

Where should that column be filled?

The column must be filled by typing the value.
However, if the field is filled through an Auto Enter value, or a Value List, or a calendar, or something given by Servoy, the data is saved. Why?

Best regards. Roberto.

Indeed the issue is reproduceable in 5.0.1, however it’s working well in latest code so the issue is fixed now. So, it should work well in next Servoy 5 release.

Thanks a lot !!!

Best Regards. Roberto.