2

I have a table in MariaDB with this spec:

CREATE TABLE `pages_txt` (
    `id` INT(10) UNSIGNED NOT NULL,
    `title` TEXT NOT NULL,
    `txt` MEDIUMTEXT NOT NULL,
    PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM;

and I want to insert about 2 million records into this table. However, after inserting about 160K records the connection dies and I receive this exception:

at Main.main(Main.java:57)
    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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.mariadb.jdbc.internal.common.QueryException: Could not send query: Last packet not finished
    at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:954)
    at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:278)
    ... 21 more
Caused by: java.io.IOException: Last packet not finished
    at org.mariadb.jdbc.internal.common.packet.PacketOutputStream.startPacket(PacketOutputStream.java:38)
    at org.mariadb.jdbc.internal.common.packet.commands.StreamedQueryPacket.send(StreamedQueryPacket.java:76)
    at org.mariadb.jdbc.internal.mysql.MySQLProtocol.executeQuery(MySQLProtocol.java:952)
    ... 22 more
java.sql.SQLNonTransientConnectionException: Could not send query: Last packet not finished
    at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:136)
    at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
    at org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:262)
    at org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:285)
    at org.mariadb.jdbc.MySQLStatement.executeUpdate(MySQLStatement.java:313)
    at org.mariadb.jdbc.MySQLPreparedStatement.executeUpdate(MySQLPreparedStatement.java:156)
    at Main$1.process(Main.java:50)

but the MariaDB server is up and working! Is there any bugs in JDBC connector??? The version is 5.5.32-MariaDB.

2
  • Please file a bug in JIRA (mariadb.atlassian.net), and include your data file. Also include parameters for the database etc. Sep 11, 2013 at 11:48
  • When this has happened with me, I was using mariaDB for my datasource using JBoss AS 7 Final. It was working perfectly till I decided to drop my database while JBoss is running, and then recreate the database. What I did to solve the problem was simply restarting JBoss. Nov 1, 2013 at 11:07

1 Answer 1

-1

https://dev.mysql.com/downloads/connector/j/

Have you tried just using the MySQL Connector/J? MySQL and MariaDB are binary compatible, and I've never run into any issues there. The MySQL Connector has the benefit of a significantly larger community.

2
  • If you have licensing concerns, the MariaDB J Connector comes with the LGPL which is less restrictive than that of MySQL (GPL). Nov 1, 2013 at 11:09
  • Your answer is not correct but by using MySQL connector, I found that the bug is in MariaDB's JDBC driver. Therefore, I accepted this :) Nov 21, 2013 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.