Cannot Save Form Data!

Hi All

I have a form that saves the data when in the developer client but when in the client connected to the server it throws the error “Cannot save form Data.”

Other forms in the same solution work fine but this one is not.

All help is appreciated.

Hi Tom,

can you find anything in the server log?

Thank you.

Here is a copy of the server log.

2010-09-27 16:12:37,581 ERROR [RMI TCP Connection(15)-127.0.0.1] com.servoy.j2db.util.Debug - Error executing sql: insert into donations (donation_id, donation_date, donation_trans_date, donation_amount, donation_currency_id, donation_id_code, donation_giver_type, donation_trans_number, donation_letter, donation_closing, donation_signature, donation_min_mess, donation_picture, donation_currency_type, donation_number) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) with params: [1339 ,type: java.lang.Long, 2010-09-28 00:00:00.0 ,type: java.sql.Timestamp, NullValue with type: 93 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 7 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 4 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, '20100928101' ,type: java.lang.String]
com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -193: Primary key for table 'donations' is not unique : Primary key value ('1339')
	at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
	at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
	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:597)
	at com.servoy.j2db.Za.Za.Zf.invoke(Zf.java:15)
	at $Proxy1.executeUpdate(Unknown Source)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at com.servoy.j2db.dataprocessing.Zu.performUpdates(Zu.java:933)
	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:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)
2010-09-27 16:12:42,508 ERROR [RMI TCP Connection(15)-127.0.0.1] com.servoy.j2db.util.Debug - Error executing sql: insert into donations (donation_id, donation_date, donation_trans_date, donation_amount, donation_currency_id, donation_id_code, donation_giver_type, donation_trans_number, donation_letter, donation_closing, donation_signature, donation_min_mess, donation_picture, donation_currency_type, donation_number) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) with params: [1339 ,type: java.lang.Long, 2010-09-28 00:00:00.0 ,type: java.sql.Timestamp, NullValue with type: 93 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 7 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 4 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, '20100928101' ,type: java.lang.String]
com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -193: Primary key for table 'donations' is not unique : Primary key value ('1339')
	at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
	at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
	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:597)
	at com.servoy.j2db.Za.Za.Zf.invoke(Zf.java:15)
	at $Proxy1.executeUpdate(Unknown Source)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at com.servoy.j2db.dataprocessing.Zu.performUpdates(Zu.java:933)
	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:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)
2010-09-27 16:12:45,548 ERROR [RMI TCP Connection(15)-127.0.0.1] com.servoy.j2db.util.Debug - Error executing sql: insert into donations (donation_id, donation_date, donation_trans_date, donation_amount, donation_currency_id, donation_id_code, donation_giver_type, donation_trans_number, donation_letter, donation_closing, donation_signature, donation_min_mess, donation_picture, donation_currency_type, donation_number) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) with params: [1339 ,type: java.lang.Long, 2010-09-28 00:00:00.0 ,type: java.sql.Timestamp, NullValue with type: 93 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 7 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 4 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, NullValue with type: 12 ,type: com.servoy.j2db.dataprocessing.ValueFactory$NullValue, '20100928101' ,type: java.lang.String]
com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -193: Primary key for table 'donations' is not unique : Primary key value ('1339')
	at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
	at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
	at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
	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:597)
	at com.servoy.j2db.Za.Za.Zf.invoke(Zf.java:15)
	at $Proxy1.executeUpdate(Unknown Source)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
	at com.servoy.j2db.dataprocessing.Zu.performUpdates(Zu.java:933)
	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:597)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
	at sun.rmi.transport.Transport$1.run(Transport.java:159)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)

I am not good at following the log.
Please Help.

it points exactly to what I was thinking of:

com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -193: Primary key for table 'donations' is not unique : Primary key value ('1339')

I guess you’re using Servoy sequence to insert your pk.
Servoy isn’t in sync with the latest pk issued in you db, therefore it tries to insert a record with an already existing pk.

As I’m not familiar using Servoy sequences, I don’t know the best way to solve the problem.
I know there’s a button to upodate the sequence on the admin pages.

Thanks Marc

That was the key. I update all the Servoy Sequences and BINGO. Everything work perfectly.

I’m a happy camper.

Thank you very much.