Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:25:49+00:00 2026-05-26T17:25:49+00:00

Hello everyone, I am using hibernate ORM and oracle database. My cfg file has

  • 0

Hello everyone,
I am using hibernate ORM and oracle database. My cfg file has following properties:

    <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property name="connection.url">jdbc:oracle:thin:@url</property>
    <property name="connection.username">username</property>
    <property name="connection.password">pasword</property>
    <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>                

    <property name="hibernate.c3p0.min_size">5</property>
    <property name="hibernate.c3p0.max_size">20</property>
    <property name="hibernate.c3p0.timeout">300</property>
    <property name="hibernate.c3p0.max_statements">50</property>
    <property name="hibernate.c3p0.idle_test_period">3000</property>    
    <property name="hibernate.c3p0.acquire_increment">3</property>

Everything works fine, but when I run the application and if I unplug network cable and plug it agian my db queries fail. It gives me the error

java.sql.SQLException: Io exception: Connection reset by peer: socket write error

Is there any way to re establish the connection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:25:50+00:00Added an answer on May 26, 2026 at 5:25 pm

    You need to configure your database connection pool – not hibernate.Try setting idleConnectionTestPeriod and an appropriate preferredTestQuery, e.g., select 1 from dual.

    See How To Configure The C3P0 ConnectionPool for more information. You’ll get the most control if you create a c3p0.properties file in WEB-INF/classes but you need to make sure not to override those properties in your hibernate.cfg.xml.

    Well I had written c3p0-config.xml like

    <c3p0-config>
    <default-config>
    <!-- Configuring Connection     Testing -->
    <!-- property name="automaticTestTable">TEST_EMS_HIBERNATE_CONN</property -->
    <property name="checkoutTimeout">0</property>
    <property name="testConnectionOnCheckout">true</property>
    <property name="testConnectionOnCheckin">false</property>
    <property name="preferredTestQuery">SELECT 1 from dual</property>
    <!-- Configuring Recovery From Database Outages -->
    <property name="acquireRetryAttempts">0</property>
    <property name="acquireRetryDelay">1000</property>
    <property name="breakAfterAcquireFailure">false</property>
    <!-- Configuring to     Debug and Workaround Broken     Client Apps     -->
    <property name="unreturnedConnectionTimeout">1800</property>
    <property name="debugUnreturnedConnectionStackTraces">true</property>
    </default-config>
    

    and the system properties like:

    C3P0_SYS_PROPS="-Dcom.mchange.v2.c3p0.cfg.xml=<FILE-PATH>/c3p0-config.xml -Dcom.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog -Dcom.mchange.v2.log.FallbackMLog.DE
    FAULT_CUTOFF_LEVEL=WARNING"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello every one I want to ask a question about file transfer using sockets.
Good evening everyone, I am using a JavaScript to load/override content from an HTML-File
Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework
Possible Duplicate: Count bytes in textarea using javascript Hello everyone. I am trying to
Hello everyone I am completely stuck with this problem. I want add the name
Hello good morning everyone, i am having a weird issue when using imagePickerController. Actually
Hello everyone. I'm using Silverlight webbrowser control, and I'm having some problems with that.
Hello good morning everyone. I am using asihttprequest for a series of images download
hello everyone im trying to create this tweak that copies a file from one
hello everyone i want validate the type of file being uploaded on sever to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.