Debian MYSQL: i18n + Sample data import failed

Servoy version 4.1.0 -build 651, repository version 35
Debian (4.1.1-20)
MYSQL

JDK Information
java.vm.name=Java HotSpot™ Client VM
java.vm.version=1.5.0_16-b02
java.vm.info=mixed mode, sharing
java.vm.vendor=Sun Microsystems Inc.

Operating System Information
os.name=Linux
os.version=2.6.18-4-vserver-686
os.arch=i386

After changing the java version from 1.6 to 1.5
see: viewtopic.php?f=11&t=11909&p=59829#p59829

we run in new problems
now we get errors importing a solution

  1. i18n data import failed
  2. Sample data import failed
[error]	i18n data import failed com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: No transaction active for id= No transaction active for id=
[info]	Skipped sample data import for adm_abt (table not empty)
[warning]	Sample data import failed for table adm_aw ,exception com.servoy.j2db.persistence.RepositoryException: java.sql.SQLException: must rollback must rollback
[error]	Sample data import failed com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: No transaction active for id= No transaction active for id=

MySQL setting for “max_allowed_packet” size we set allredy to 256M
Also deleting and building a new Repository → same Error

What running wrong this time ?

Hi ledergerber,

You say you use MySQL, what version of MySQL ?
Also are you using a matching (or latest) JDBC driver?
Also are you using MyISAM tables ? These don’t support transactions, something Servoy requires for the repository. You need to use InnoDB tables instead.

Hope this helps.

Robert, thank you

we use
MYSQL 5.0.32
What a matching JDBC driver ?
What will be the latest one?

we tried:
mysql.connector-java-3.1.14-bin.jar
mysql.connector-java-5.0.8-bin.jar
mysql.connector-java-5.1.7-bin.jar

And yes we use the InnoDB and the configuration from the Servoy & MySQL Mini HowTO
http://www.sintpro.com/downloads/Servoy … iHowTo.pdf

Thomas

Hi Thomas,

ledergerber:
we use
MYSQL 5.0.32
What a matching JDBC driver ?
What will be the latest one?

A matching one is a JDBC driver from the same release (5.0.x) But a newer one should work too as they (should) be backwards compatible (in this case 5.1.x)

ledergerber:
we tried:
mysql.connector-java-3.1.14-bin.jar
mysql.connector-java-5.0.8-bin.jar
mysql.connector-java-5.1.7-bin.jar

There are indeed the latest versions of their release.
Do you have only ONE mysql driver in the drivers directory ? Having multiple drivers of the same database brand in the drivers directory is a big no-no.

Hope this helps.

Hi Robert,

thank you, good to know we use the right drivers and the latest versions.
So that will not be the problem.

Do you have only ONE mysql driver in the drivers directory ? Having multiple drivers of the same database brand in the drivers directory is a big no-no.

Of course only one mysl driver driver is in the drivers directory

Any other Ideas ?
Thomas

What errors do you have in the servoy_log.txt ?

Hi Thomas, a couple of things to check:

  1. Are you using InnoDB for the servoy repository database? That is mandatory since Servoy needs transaction support at least for the repo;
  2. Check you DB connection settings, you must have at least 2 connections for the “Maximum connections active”, if you have only 1 Servoy will not be able to import a solution.

Hi Nicola,

  1. yes we use the InnoDB for the servoy repository database
  2. “Maximum connections active”: we are using the default value 10
  3. I guess all is set up as described in the mini howto
    unless “The validation Query”, which can not be set at all

We can import the solutions, but the i18n and the sample data import failed

Thomas

Did you check ALL database connections? Looks like the issue is related to the DB which holds the i18n table and the solution data, not to the repo.
Maybe you could post a screenshot of the DB Servers page (from admin pages).
What do you mean you cannot set the validation query?

Did you check the log to see the full error as Laurian suggested?

Hi Nicola,

Yes I checked all database connections.
I will send you a screenshot.

In the MySQL MiniHowTo the “validation query” is set to 1.
In the admin database settings it is not editable.

Here are two small block from the log file

2009-01-30 15:56:15,898 ERROR [http-8080-1] com.servoy.j2db.util.Debug - Error executing sql: insert into i18n_messages (message_value,message_key,message_language,messagesid) values (?,?,?,?) with params: [[Ljava.lang.Object;@2dbfc1]
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'message_value' at row 1
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3513)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
	at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
	at sun.reflect.GeneratedMethodAccessor421.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.Ze.invoke(Ze.java:1)
	at $Proxy0.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:352)
	at com.servoy.j2db.dataprocessing.SQLEngine.doI18NUpdates(SQLEngine.java:483)
	at com.servoy.j2db.persistence.Zed.Zb(Zed.java:841)
	at com.servoy.j2db.persistence.Zed.Za(Zed.java:309)
	at com.servoy.j2db.persistence.XMLImporter.importFromJarFile(XMLImporter.java:19)
	at com.servoy.j2db.server.servlets.ConfigServlet.Zk(ConfigServlet.java:2214)
	at com.servoy.j2db.server.servlets.ConfigServlet.service(ConfigServlet.java:984)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	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:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:595)
2009-01-30 15:56:16,361 ERROR [http-8080-1] com.servoy.j2db.util.Debug - Error executing sql: insert into i18n_messages (message_value,message_key,message_language,messagesid) values (?,?,?,?) with params: [[Ljava.lang.Object;@7eedbb]
java.sql.SQLException: must rollback
	at com.servoy.j2db.persistence.datasource.TransactionConnection.startTransaction(TransactionConnection.java:21)
	at com.servoy.j2db.dataprocessing.SQLEngine.performUpdates(SQLEngine.java:265)
	at com.servoy.j2db.dataprocessing.SQLEngine.doI18NUpdates(SQLEngine.java:483)
	at com.servoy.j2db.persistence.Zed.Zb(Zed.java:841)
	at com.servoy.j2db.persistence.Zed.Za(Zed.java:309)
	at com.servoy.j2db.persistence.XMLImporter.importFromJarFile(XMLImporter.java:19)
	at com.servoy.j2db.server.servlets.ConfigServlet.Zk(ConfigServlet.java:2214)
	at com.servoy.j2db.server.servlets.ConfigServlet.service(ConfigServlet.java:984)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	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:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:595)

because of the Error in the logfile

(message_value,message_key,message_language,messagesid) values (?,?,?,?) with params: [[Ljava.lang.Object;@2dbfc1]
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘message_value’ at row 1

I checked in mysql the field ‘message_value’ in the i18n table:
the length of the field is set to 16777215 !! ?
Looks like importing the solution is setting the length from normally 2000 to 16777215.

Checking other text fields in the solution, shows that other text field above circa a length from 500 are all set to 16777215.

Then I guess you should alter your table using some tool, restart servoy and try again.
About the validation query: you can only set the validation query when you create the server connection, once the connection is saved you cannot change it anymore in the admin pgaes GUI but you can stop servoy, open the servoy.properies file and apply the change there. Remember to use “select 1;” for the validation query of every db.

About the validation query:
Setting validation query to 1 of every db in the servoy.properies file ( server.x.validationQuery=1 )

and restarting the deveolper an Error:

Error creating the view.
Could not create a vailidated object.

Set it like this: server.x.validationQuery=select 1;

Hi Nicola,

Set it like this: server.x.validationQuery=select 1;

that works, thank you! Can start the developer again

And after changing
the datatype from the field ‘message_value’ in the i18n tables in mysql
from datatype ‘MEDIUMTEXT’ to ‘VARCHAR(2000)’
it looks like the import form the i18n is working fine! :-)

But why are changing the fieldtype from textfields above circa a length from 500 to datatype MEDIUMTEXT,
if a MSSQL exportfile is imported in a MySQL DB ?

I guess thats the problem why I can not import the Sample data.

That’s a good question, maybe Rob Gansevles can answer this one.

Hi Nicola,
many many thanks for your help!

But why are changing the fieldtype from textfields above circa a length from 500 to datatype MEDIUMTEXT,
if a MSSQL exportfile is imported in a MySQL DB ?

I reported it in a new case to the servoy support team.

Thomas

ledergerber:
But why are changing the fieldtype from textfields above circa a length from 500 to datatype MEDIUMTEXT,
if a MSSQL exportfile is imported in a MySQL DB ?

I guess thats the problem why I can not import the Sample data.

Servoy has a dialect per database type that defines the database-specific types to be used.
The MySql dialect uses varchar(n) up to length 255 and mediumtext for longer size.
Before MySQL 5.0.3 255 was the max length for varchar columns, this has changed in MySQL 5.0.3 (see http://dev.mysql.com/doc/refman/5.0/en/ … rview.html )

We will adjust our mysql dialect accordingly.

But there is still the issue that you had the ‘Data too long for column’ error, the mediumtext column allows more that 16000 bytes, do you have such long messages?
Note that the effective length maybe smaller if the value contains multi-byte characters, but this is still quite long.

Rob

Hi Rob,

thank you!

Servoy has a dialect per database type that defines the database-specific types to be used.
The MySql dialect uses varchar(n) up to length 255 and mediumtext for longer size.
Before MySQL 5.0.3 255 was the max length for varchar columns, this has changed in MySQL 5.0.3 (see http://dev.mysql.com/doc/refman/5.0/en/ … rview.html )

Hmmm … ok.
But I wonder, why the i18n import was working fine on the same machine with the same MySQL version and Servoy Version 3.5?
After changing to Servoy 4.1 the problem was coming up.
So it looks like there are some changes in the dialect for MySQL in the Servoy 4 version?

Thomas

ledergerber:
So it looks like there are some changes in the dialect for MySQL in the Servoy 4 version?

Thomas

Thomas,

Maybe you can provide us with the solution so we can investigate.

Thanks,

Rob