facebook

Solution JPA/Hibernate or just Hibernate and MySQL Timeouts

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #281693 Reply

    frankc01a
    Member

    Add this to persist.xml or if using straight hibernate add to the hibernate configuration:

    
        <properties>
                <property name="hibernate.connection.username" value="frank" />
                <property name="hibernate.connection.password" value="Jane6194" />
                <property name="hibernate.hbm2ddl.auto" value="update" />
                <property name="hibernate.c3p0.acquire_increment" value="3"/>
                <property name="hibernate.c3p0.idle_test_period" value="14400"/>
                <property name="hibernate.c3p0.timeout" value="25200"/>
                <property name="hibernate.c3p0.max_size" value="15"/>
                <property name="hibernate.c3p0.min_size" value="3"/>
                <property name="hibernate.c3p0.max_statements" value="0"/>
                <property name="hibernate.c3p0.preferredTestQuery" value="select 1;"/>    
       </properties>
    
    

    It checks for invalid connections in the cache. By default, MySQL timesout after 8 hours of inactivity

    #281712 Reply

    Loyal Water
    Member

    frankc01a,
    Thanks for taking time out to post this. We appreciate it.

    #281854 Reply

    frankc01a
    Member

    I would like to request that MyEclipse add this as a feature “checkbox” when adding JPA capability w/Hibernate or just adding Hibernate. It should auto fill in the relevant information in persist.xml or hibernate configuration files.

    Frank

    #281861 Reply

    Loyal Water
    Member

    Frank,
    I’ll make a note of this feature request. Thank you for your feedback.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Solution JPA/Hibernate or just Hibernate and MySQL Timeouts

You must be logged in to post in the forum log in