Since Sybase the following was introduced:
When I try to delete a record I sometimes get the message:
‘Could not delete record, try showAll records’. The description says:
‘Index: 0, Size: 0’…
What does this mean?
Since Sybase the following was introduced:
When I try to delete a record I sometimes get the message:
‘Could not delete record, try showAll records’. The description says:
‘Index: 0, Size: 0’…
What does this mean?
not sure, send .log.txt file so we can check it out.
I am getting this now, too. In my case, this is what happens:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The specified SQL type is not supported by this driver.java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The specified SQL type is not supported by this driver.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.validateSqlType(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.servoy.j2db.persistence.datasource.p.invoke(Unknown Source)
at $Proxy0.setObject(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:229)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:229)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:229)
at com.servoy.j2db.dataprocessing.SQLEngine.performUpdates(Unknown Source)
at com.servoy.j2db.dataprocessing.at.a(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.deleteRecord(Unknown Source)
at com.servoy.j2db.FormPanel.ck(Unknown Source)
at com.servoy.j2db.FormPanel.access$2(Unknown Source)
at com.servoy.j2db.FormPanel$JSForm.js_deleteRecord(Unknown Source)
at inv12.invoke()
at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:537)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:453)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1237)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.n.a(Unknown Source)
at com.servoy.j2db.develop.debugger.n.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at com.servoy.j2db.util.b.setVisible(Unknown Source)
at com.servoy.j2db.h.setVisible(Unknown Source)
at com.servoy.j2db.h.a(Unknown Source)
at com.servoy.j2db.FormManager.a(Unknown Source)
at com.servoy.j2db.scripting.JSApplication.js_showFormInDialog(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1237)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1237)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.n.a(Unknown Source)
at com.servoy.j2db.develop.debugger.n.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.repostEvent(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
what is youre table structure?
I like to know what the PK is of that table (what type)
It is a very simple table (5 columns or so); the PK is a DB sequence.
and is the record you are trying to delete already saved?
Or are you trying to delete a record that is just made?
I am not really sure. I think it is not saved yet. Part of the problem might be, that we are in the midst of a transaction, too.
One thing is for sure: If I create a record in those dialogs, close all of them (committing the transaction), go back into all this and delete the record then, there is no problem. The problem seems only to occur if you create a record and then delete it…
then it seems that the dataprovider that is the PK is still NULL.
But the record is already saved to the db.
Are you sure that the pk column in servoy is specified as DB seq/ident?
Can you output the pk of that record in youre form? So that you can see what the value is at one moment?
you are right! In the cases where I get that error, the PK is still empty. Once it is there (if I click on another record etc.), there is no problem.
and if you see that field. And you trigger a saveData. Is then the pk not filled in???
Because this should happen..
right now I don’t do anything if you hit that button “New”. It just calls controller.newRecord(). Of course, what I could do is a saveData() right after that… Is that what you telling me to do?
or if you press in a place on the form that is not a field. So the [e] is gone and it is saved.
But are you saying that you get this method when you do just new and then directly delete? Because then it shouldn’t trigger a database update, because it will see that the record is not yet saved. It will only trigger if the record is saved. And it seems that even then youre newrecord doesn’t have the pk set, that is what i want to know.
Yes, this is how it looks like: if I create a record and don’t have a primary key yet, I get this error. But this only seems to happen if the table is shown in a form in dialog.
If I do newRecord and immediately afterwards a saveRecord, then everything is fine…