I find these entries in the log since I’ve updated servoy to 3.1.x (3.1.5 now), anyone has seen these before?
Looks like it’s related to the log database.
java.sql.SQLException: no transaction in progress
at com.servoy.j2db.persistence.datasource.TransactionConnection.rollback(Unknown Source)
at com.servoy.j2db.util.Utils.rollback(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.access$300(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine$b.run(Unknown Source)
at com.servoy.j2db.util.al.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'new_data' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2939)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1541)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1455)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1440)
at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.servoy.j2db.persistence.datasource.p.invoke(Unknown Source)
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.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.access$300(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine$b.run(Unknown Source)
at com.servoy.j2db.util.al.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)
Yes! This is a typical poblem when you try to log a field with a length larger than the length in the log table. I have asked before that Servoy checks this and either shortens what is there or simply ignores BLOBs and long text fields (such as CLOBs in Oracle).
Anyway, that error is not a problem, it simply says that this field is not logged.
I was suspecting that, thanks Patrick!
It’s quite annoying to see everyday all those entries in the log, is it possible to fix this issue or at least use the DEBUG Log level so to not pollute the INFO and WARN levels?
this is a bit odd, we do test if it should fit or not (also in 3.1.5) and when the string new or old data is to long we just truncate it. And it should use the same maxlength setting when you create your table.
What size is your new_data column? you could make it much larger if you want.
I tried changing the type of new_data and old_data from TEXT to LONGTEXT:
mysql> describe log;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| user_name | varchar(100) | YES | | NULL | |
| log_id | int(11) | NO | PRI | 0 | |
| table_name | varchar(50) | YES | | NULL | |
| server_name | varchar(50) | YES | | NULL | |
| log_action | int(11) | YES | | NULL | |
| event_time | datetime | YES | | NULL | |
| column_name | varchar(50) | YES | | NULL | |
| pk_data | varchar(200) | YES | | NULL | |
| old_data | longtext | YES | | NULL | |
| new_data | longtext | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
10 rows in set (0.00 sec)
But I continue to get errors in the log.
Any hints?
that is very odd then because you can store now many many chars
can you upgrade to the latest mysql driver?
The strange thing is that looking in the log table for rows written when the error occurs I see only rows related to 2 tables: articoli and difetti and those two tables don’t contain large data in any column.
Here’s the structure of the two tables:
mysql> describe sprint.articoli;
+--------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------------+--------------+------+-----+---------+-------+
| articoli_id | int(11) | NO | PRI | 0 | |
| categoria | varchar(50) | YES | MUL | NULL | |
| marca | varchar(50) | YES | MUL | NULL | |
| modello | varchar(100) | YES | MUL | NULL | |
| serial_number | varchar(50) | YES | MUL | NULL | |
| tracking_ref | varchar(24) | YES | | NULL | |
| quantita | int(11) | YES | | NULL | |
| ubicazione | varchar(100) | YES | | NULL | |
| id_ddt | int(11) | YES | MUL | NULL | |
| procedura | varchar(50) | YES | | NULL | |
| load_number | int(11) | YES | | NULL | |
| data_ricezione | datetime | YES | | NULL | |
| lease_number | varchar(50) | YES | | NULL | |
| dock_portrep | char(1) | YES | | NULL | |
| coa | varchar(50) | YES | | NULL | |
| annotazioni | text | YES | | NULL | |
| pc_cpu_in | varchar(50) | YES | | NULL | |
| pc_ram_in | varchar(50) | YES | | NULL | |
| pc_hd_in | varchar(50) | YES | | NULL | |
| pc_cd_in | varchar(50) | YES | | NULL | |
| pc_backup_in | varchar(50) | YES | | NULL | |
| pc_modem_in | varchar(50) | YES | | NULL | |
| pc_chassis_in | varchar(50) | YES | | NULL | |
| monitor_tipo | varchar(50) | YES | | NULL | |
| monitor_ampiezza | varchar(50) | YES | | NULL | |
| printer_tipo | varchar(50) | YES | | NULL | |
| printer_formato | varchar(10) | YES | | NULL | |
| pc_cpu_out | varchar(50) | YES | | NULL | |
| pc_ram_out | varchar(50) | YES | | NULL | |
| pc_hd_out | varchar(50) | YES | | NULL | |
| pc_cd_out | varchar(50) | YES | | NULL | |
| pc_backup_out | varchar(50) | YES | | NULL | |
| pc_modem_out | varchar(50) | YES | | NULL | |
| pc_chassis_out | varchar(50) | YES | | NULL | |
| descrizione_in | text | YES | | NULL | |
| descrizione_out | text | YES | | NULL | |
| del_coll | varchar(10) | YES | | NULL | |
| seriale_old | varchar(50) | YES | | NULL | |
| data_creazione | datetime | YES | | NULL | |
| data_modifica | datetime | YES | | NULL | |
| creatore | varchar(50) | YES | | NULL | |
| modificatore | varchar(50) | YES | | NULL | |
| lotto | varchar(50) | YES | | NULL | |
| quantita_attesa | int(11) | YES | | NULL | |
| condizioni | text | YES | | NULL | |
| id_off_acquisto | int(11) | YES | MUL | NULL | |
| classe_fmv | text | YES | MUL | NULL | |
| provenienza | varchar(50) | YES | | NULL | |
| agente | varchar(50) | YES | | NULL | |
| id_off_acquisto_righe | int(11) | YES | MUL | NULL | |
| valore | float | YES | | NULL | |
| listino_in | varchar(50) | YES | | NULL | |
| mwd_codes_difetti | text | YES | | NULL | |
| marker | int(11) | YES | | NULL | |
| lavorazione | varchar(50) | YES | | NULL | |
| internal_grade | int(11) | YES | | NULL | |
| conto_difetti | int(11) | YES | | NULL | |
| riassunto_descrizione | text | YES | | NULL | |
| report_spec | varchar(50) | YES | MUL | NULL | |
| data_status_cliente | datetime | YES | | NULL | |
| utente_status | varchar(50) | YES | | NULL | |
| utente_status_cliente | varchar(50) | YES | | NULL | |
| utente_valutazione | varchar(50) | YES | | NULL | |
| utente_engineering | varchar(50) | YES | MUL | NULL | |
| status | varchar(50) | YES | MUL | NULL | |
| valutazione | int(11) | YES | | NULL | |
| engineering | int(11) | YES | | NULL | |
| data_status | datetime | YES | | NULL | |
| data_engineering | datetime | YES | | NULL | |
| data_valutazione | datetime | YES | | NULL | |
| status_cliente | varchar(50) | YES | | NULL | |
| totale_peso | float | YES | | NULL | |
| partners_dettagli | text | YES | | NULL | |
| partners_serial_number | varchar(50) | YES | | NULL | |
| partners_marca | varchar(50) | YES | MUL | NULL | |
| partners_modello | varchar(100) | YES | MUL | NULL | |
| note_tecnico | text | YES | | NULL | |
| process_grade | varchar(5) | YES | | NULL | |
| vendita_provvisorio | text | YES | | NULL | |
| prezzo_fmv | float | YES | | NULL | |
| costi_commissioni | float | YES | | NULL | |
| costi_ricevimento | float | YES | | NULL | |
| net_return | float | YES | | NULL | |
| costi_trasporto | float | YES | | NULL | |
| costi_guasti | float | YES | | NULL | |
| costi_processing | float | YES | | NULL | |
| process_grade_report_cit | varchar(2) | YES | | NULL | |
| prezzo_acquisto | float | YES | | NULL | |
| id_bancale | int(11) | YES | MUL | NULL | |
| utente_selezione | varchar(50) | YES | | NULL | |
| id_disposizione | int(11) | YES | | NULL | |
| quantita_disponibile | int(11) | YES | | NULL | |
| data_spedizione_provv | datetime | YES | | NULL | |
| id_off_vendita | int(11) | YES | MUL | NULL | |
| opzioni | int(11) | YES | | NULL | |
| id_pre_estrazione | int(11) | YES | | NULL | |
+--------------------------+--------------+------+-----+---------+-------+
96 rows in set (0.00 sec)
mysql> describe sprint.difetti;
+-----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| difettiid | int(11) | NO | PRI | 0 | |
| id_articolo | int(11) | YES | MUL | NULL | |
| codice | varchar(50) | YES | | NULL | |
| grade | varchar(2) | YES | | NULL | |
| descrizione_ita | text | YES | | NULL | |
| descrizione_eng | text | YES | | NULL | |
| peso | int(11) | YES | | NULL | |
| costo_guasto | float | YES | | NULL | |
| mwod | char(1) | YES | | NULL | |
+-----------------+-------------+------+-----+---------+-------+
9 rows in set (0.00 sec)
Maybe the error automatically rolled back the transaction (hence the other error in the log) and the data that is causing the error is not saved to the log table?
Can you confirm that you are writing in the log table inside a transaction?
I’m using mysql-connector-java-5.0.5-bin.jar, I’ll try to upgrade to 5.0.6 (the latest available build).
no there is no transaction. and no it isn’t rollbacked. That error is just happening because mysql report the error of data is to long.
we just need to have a quick testcase for this where it is reproduceable because it seems that all your columns should handle large strings.