3
votes

I recently updated my MySQL server to MariaDB, since then I'm getting in trouble with a few errors.

After some time, my application crashes and these errors appear:

java.util.NoSuchElementException: Timeout waiting for idle object

or

Cannot get a connection, pool error Timeout waiting for idle object

Or NullPointerExceptions on executeUpdate() on a preparedStatement!

My code to connect to the database is:

public static void connect() {
    try {
        connection = DriverManager.getConnection("jdbc:mysql://"
                + Data.MySQL_host + ":3306/" + Data.MySQL_db,
                Data.MySQL_user, Data.MySQL_pass);
        System.out.println("MySQL connected!");
    } catch (SQLException e) {
        System.out.println("Error connecting to MySQL");
        e.printStackTrace();
    }
}

Do I have to modify my MariaDB Server, or is it application-related?

1
Does "after some time" mean something special? Is it like randomly or after x seconds after the last query was executed? Do you close the connection before using it again? ... So many questions left :) - Dennis Ziolkowski
I don't know if it's randomly. I'm continuously sending and requesting data from MySQL, but it seems quite randomly. No, I'm using the same connection for all statements. - Kombustor

1 Answers

0
votes

something wrong wiht your configuration,so you can't get a idle Object to connect.chekout your configuration first!