Results 1 to 2 of 2

Thread: Are there MySQL versions which are more robust and suitable for a multi-threaded Java

  1. #1
    Join Date
    Sep 2010
    Posts
    17

    Default Are there MySQL versions which are more robust and suitable for a multi-threaded Java

    Are there MySQL versions which are more robust and suitable for a multi-threaded Java EE, Hibernate and Ehcache application? The Servletcontainer is Jetty.
    Right now I think we're using MySQL v5.1.50 under FreeBSD and I'm getting:
    ************************************************** ******************************
    ************************************************** ******************************
    ************************************************** ******************************
    ************************************************** ******************************
    2011-09-05 16:55:18,350 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 1205, SQLState: 41000>
    2011-09-05 16:55:18,350 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Lock wait timeout exceeded; try restarting transaction>
    2011-09-05 16:55:18,352 ERROR [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Could not synchronize database state with session>
    org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.handledN onSpecificException(SQLStateConverter.java:126)
    at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:114)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:66)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(Ab stractBatcher.java:275)
    at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:266)
    at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:168)
    at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:50)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1027)
    at org.hibernate.ejb.AbstractEntityManagerImpl.flush( AbstractEntityManagerImpl.java:304)
    at sun.reflect.GeneratedMethodAccessor27.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.orm.jpa.SharedEntityManagerCre ator$SharedEntityManagerInvocationHandler.invoke(S haredEntityManagerCreator.java:198)
    at $Proxy38.flush(Unknown Source)

    ************************************************** ****************************
    ************************************************** ****************************
    ************************************************** ****************************
    ************************************************** ****************************
    AND

    2011-06-23 11:19:25,910 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Column 'campaign_contract_id' cannot be null>
    2011-06-23 11:19:25,967 ERROR [adx.main] - <Stats job failed for >
    javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwP ersistenceException(AbstractEntityManagerImpl.java :614)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persis t(AbstractEntityManagerImpl.java:226)
    at sun.reflect.GeneratedMethodAccessor63.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.orm.jpa.SharedEntityManagerCre ator$SharedEntityManagerInvocationHandler.invoke(S haredEntityManagerCreator.java:198)
    at $Proxy37.persist(Unknown Source)
    ************************************************** ******************************
    ************************************************** ******************************
    ************************************************** ******************************
    ************************************************** ******************************
    Every now and then and I'm having to restart the mysql server. That used to fix it. But now I'm getting more and more of it. A cell in the database gets corrupt and merely trying to alter the contents of that row it in PhpMyAdmin doesn't work. It tries for a long time and then exits with an errormessage. After a restart of the mysql-server it usually works. Now I'm getting more and more of these incidents. Now even the single threaded Java EE servlet are experiencing these problems. We have 2 different physical servers running Java EE Webapplications against the same MySQL server. Synchronization in the sense of one Hibernate cache not knowing that a row has been modified by the other Java server or PHP has not been an issue. A dirty flag is set and everyone knows that the row is dirty.

    Will upgrading to MySQL v5.5 solve these problems? Or are there other more robust versions of MySQL?

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    Next time use code tags to post the error stack trace

    The error is clear

    Code:
    2011-06-23 11:19:25,910 ERROR [org.hibernate.util.JDBCExceptionReporter] - 
    <Column 'campaign_contract_id' cannot be null>
    You are trying to insert a column with a null value (explicitly or implicitly) and the DB constraints expect a non null value, therefore you have there your exception

    Check your POJO where you are defining or making your mapping with the DB through Hibernate
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •