Search Results

Search found 57 results on 3 pages for 'c3p0'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Hibernate Communications Link Failure in Hibernate Based Java Servlet application powered by MySQL

    - by Vatsala
    Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i.e. when there are no queries issued to MySQL for more than approximately 6 hours). I am pasting a top 'exception' level description below, and adding a pastebin link for a detailed stacktrace description. javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Cannot open connection - Caused by: org.hibernate.exception.JDBCConnectionException: Cannot open connection - Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure - The last packet successfully received from the server was 1,274,868,181,212 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. - Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure - The last packet successfully received from the server was 1,274,868,181,212 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. - Caused by: java.net.ConnectException: Connection refused: connect the link to the pastebin for further investigation - http://pastebin.com/4KujAmgD What I understand from these exception statements is that MySQL is refusing to take in any connections after a period of idle/nil activity. I have been reading up a bit about this via google search, and came to know that one of the possible ways to overcome this is to set values for c3p0 properties as c3p0 comes bundled with Hibernate. Specifically, I read from here http://www.mchange.com/projects/c3p0/index.html that setting two properties idleConnectionTestPeriod and preferredTestQuery will solve this for me. But these values dont seem to have had an effect. Is this the correct approach to fixing this? If not, what is the right way to get over this? The following are related Communications Link Failure questions at stackoverflow.com, but I've not found a satisfactory answer in their answers. http://stackoverflow.com/questions/2121829/java-db-communications-link-failure http://stackoverflow.com/questions/298988/how-to-handle-communication-link-failure Note 1 - i dont get this error when I am using my application continuosly. Note 2 - I use JPA with Hibernate and hence my hibernate.dialect,etc hibernate properties reside within the persistence.xml in the META-INF folder (does that prevent the c3p0 properties from working?) edit - Here are the c3p0 parameters I tried out - select 1; 2

    Read the article

  • java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

    - by Panayiotis Karabassis
    I am getting this error: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z These are the jars in my classpath: com.sun.faces/jsf-api/jars/jsf-api-2.0.0.jar com.sun.faces/jsf-impl/jars/jsf-impl-2.0.0.jar org.apache.myfaces.orchestra/myfaces-orchestra-core20/jars/myfaces-orchestra-core20-1.5-SNAPSHOT.jar commons-lang/commons-lang/jars/commons-lang-2.1.jar commons-logging/commons-logging/jars/commons-logging-1.1.1.jar org.springframework/spring/jars/spring-2.5.6.jar commons-el/commons-el/jars/commons-el-1.0.jar org.richfaces.ui/richfaces-ui/jars/richfaces-ui-3.3.3.Final.jar org.richfaces.framework/richfaces-api/jars/richfaces-api-3.3.3.Final.jar commons-collections/commons-collections/jars/commons-collections-3.2.jar commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.0.jar org.richfaces.framework/richfaces-impl-jsf2/jars/richfaces-impl-jsf2-3.3.3.Final.jar com.sun.facelets/jsf-facelets/jars/jsf-facelets-1.1.14.jar org.hibernate/hibernate-core/jars/hibernate-core-3.6.0.Final.jar antlr/antlr/jars/antlr-2.7.6.jar dom4j/dom4j/jars/dom4j-1.6.1.jar org.hibernate/hibernate-commons-annotations/jars/hibernate-commons-annotations-3.2.0.Final.jar org.slf4j/slf4j-api/jars/slf4j-api-1.6.1.jar org.hibernate.javax.persistence/hibernate-jpa-2.0-api/jars/hibernate-jpa-2.0-api-1.0.0.Final.jar javax.transaction/jta/jars/jta-1.1.jar org.hibernate/hibernate-c3p0/jars/hibernate-c3p0-3.6.0.Final.jar c3p0/c3p0/jars/c3p0-0.9.1.jar org.hibernate/hibernate-entitymanager/jars/hibernate-entitymanager-3.6.0.Final.jar cglib/cglib/jars/cglib-2.2.jar asm/asm/jars/asm-3.1.jar javassist/javassist/jars/javassist-3.12.0.GA.jar org.hibernate/hibernate-search/jars/hibernate-search-3.3.0.Final.jar org.hibernate/hibernate-search-analyzers/jars/hibernate-search-analyzers-3.3.0.Final.jar org.apache.lucene/lucene-core/jars/lucene-core-3.0.3.jar org.apache.lucene/lucene-analyzers/jars/lucene-analyzers-3.0.3.jar mysql/mysql-connector-java/jars/mysql-connector-java-5.1.13.jar com.ocpsoft/prettyfaces-jsf2/jars/prettyfaces-jsf2-3.0.1.jar commons-digester/commons-digester/jars/commons-digester-2.0.jar org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.1.jar log4j/log4j/bundles/log4j-1.2.16.jar xom/xom/jars/xom-1.2.5.jar xml-apis/xml-apis/jars/xml-apis-1.3.03.jar xerces/xercesImpl/jars/xercesImpl-2.8.0.jar xalan/xalan/jars/xalan-2.7.0.jar org.jboss.jsfunit/jboss-jsfunit-core/jars/jboss-jsfunit-core-1.3.0.Final.jar net.sourceforge.htmlunit/htmlunit/jars/htmlunit-2.8.jar xalan/xalan/jars/xalan-2.7.1.jar xalan/serializer/jars/serializer-2.7.1.jar xml-apis/xml-apis/jars/xml-apis-1.3.04.jar commons-collections/commons-collections/jars/commons-collections-3.2.1.jar commons-lang/commons-lang/jars/commons-lang-2.4.jar org.apache.httpcomponents/httpclient/jars/httpclient-4.0.1.jar org.apache.httpcomponents/httpcore/jars/httpcore-4.0.1.jar commons-codec/commons-codec/jars/commons-codec-1.4.jar org.apache.httpcomponents/httpmime/jars/httpmime-4.0.1.jar org.apache.james/apache-mime4j/jars/apache-mime4j-0.6.jar net.sourceforge.htmlunit/htmlunit-core-js/jars/htmlunit-core-js-2.8.jar xerces/xercesImpl/jars/xercesImpl-2.9.1.jar net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.14.jar net.sourceforge.cssparser/cssparser/jars/cssparser-0.9.5.jar org.w3c.css/sac/jars/sac-1.3.jar commons-io/commons-io/jars/commons-io-1.4.jar cactus/cactus/jars/cactus-13-1.7.1.jar cactus/cactus-ant/jars/cactus-ant-13-1.7.1.jar commons-httpclient/commons-httpclient/jars/commons-httpclient-2.0.2.jar junit/junit/jars/junit-3.8.1.jar aspectj/aspectjrt/jars/aspectjrt-1.2.1.jar cargo/cargo/jars/cargo-0.5.jar ant/ant/jars/ant-1.5.4.jar and this is my ivy.xml: <dependencies> <!-- JSF 2.0 RI --> <dependency org="com.sun.faces" name="jsf-api" rev="2.0.0"/> <dependency org="com.sun.faces" name="jsf-impl" rev="2.0.0"/> <!-- MyFaces Orchestra --> <dependency org="org.apache.myfaces.orchestra" name="myfaces-orchestra-core20" rev="1.5-SNAPSHOT"/> <dependency org="org.springframework" name="spring" rev="2.5.6"/> <dependency org="commons-el" name="commons-el" rev="1.0"/> <!-- RichFaces --> <dependency org="org.richfaces.ui" name="richfaces-ui" rev="3.3.3.Final"/> <dependency org="org.richfaces.framework" name="richfaces-impl-jsf2" rev="3.3.3.Final"/> <dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.14"/> <!-- Hibernate --> <dependency org="org.hibernate" name="hibernate-core" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-c3p0" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-search" rev="3.3.0.Final"/> <dependency org="mysql" name="mysql-connector-java" rev="5.1.13"/> <!-- PrettyFaces --> <dependency org="com.ocpsoft" name="prettyfaces-jsf2" rev="3.0.1"/> <!-- SLF4J --> <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/> <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1"/> <!-- XOM --> <dependency org="xom" name="xom" rev="1.2.5"/> <!-- JSF Unit --> <dependency org="org.jboss.jsfunit" name="jboss-jsfunit-core" rev="1.3.0.Final" conf="development"/> </dependencies> I am deploying to tomcat 6.0 Update After the answer below, I solved this by adding the following dependency to my ivy.xml: <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.0.Final"/> then putting this jar above everything else under Eclipse's build order tab. I was using JRE/JDK 6.

    Read the article

  • java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z

    - by Panayiotis Karabassis
    I am getting this error: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z These are the jars in my classpath: com.sun.faces/jsf-api/jars/jsf-api-2.0.0.jar com.sun.faces/jsf-impl/jars/jsf-impl-2.0.0.jar org.apache.myfaces.orchestra/myfaces-orchestra-core20/jars/myfaces-orchestra-core20-1.5-SNAPSHOT.jar commons-lang/commons-lang/jars/commons-lang-2.1.jar commons-logging/commons-logging/jars/commons-logging-1.1.1.jar org.springframework/spring/jars/spring-2.5.6.jar commons-el/commons-el/jars/commons-el-1.0.jar org.richfaces.ui/richfaces-ui/jars/richfaces-ui-3.3.3.Final.jar org.richfaces.framework/richfaces-api/jars/richfaces-api-3.3.3.Final.jar commons-collections/commons-collections/jars/commons-collections-3.2.jar commons-beanutils/commons-beanutils/jars/commons-beanutils-1.8.0.jar org.richfaces.framework/richfaces-impl-jsf2/jars/richfaces-impl-jsf2-3.3.3.Final.jar com.sun.facelets/jsf-facelets/jars/jsf-facelets-1.1.14.jar org.hibernate/hibernate-core/jars/hibernate-core-3.6.0.Final.jar antlr/antlr/jars/antlr-2.7.6.jar dom4j/dom4j/jars/dom4j-1.6.1.jar org.hibernate/hibernate-commons-annotations/jars/hibernate-commons-annotations-3.2.0.Final.jar org.slf4j/slf4j-api/jars/slf4j-api-1.6.1.jar org.hibernate.javax.persistence/hibernate-jpa-2.0-api/jars/hibernate-jpa-2.0-api-1.0.0.Final.jar javax.transaction/jta/jars/jta-1.1.jar org.hibernate/hibernate-c3p0/jars/hibernate-c3p0-3.6.0.Final.jar c3p0/c3p0/jars/c3p0-0.9.1.jar org.hibernate/hibernate-entitymanager/jars/hibernate-entitymanager-3.6.0.Final.jar cglib/cglib/jars/cglib-2.2.jar asm/asm/jars/asm-3.1.jar javassist/javassist/jars/javassist-3.12.0.GA.jar org.hibernate/hibernate-search/jars/hibernate-search-3.3.0.Final.jar org.hibernate/hibernate-search-analyzers/jars/hibernate-search-analyzers-3.3.0.Final.jar org.apache.lucene/lucene-core/jars/lucene-core-3.0.3.jar org.apache.lucene/lucene-analyzers/jars/lucene-analyzers-3.0.3.jar mysql/mysql-connector-java/jars/mysql-connector-java-5.1.13.jar com.ocpsoft/prettyfaces-jsf2/jars/prettyfaces-jsf2-3.0.1.jar commons-digester/commons-digester/jars/commons-digester-2.0.jar org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.1.jar log4j/log4j/bundles/log4j-1.2.16.jar xom/xom/jars/xom-1.2.5.jar xml-apis/xml-apis/jars/xml-apis-1.3.03.jar xerces/xercesImpl/jars/xercesImpl-2.8.0.jar xalan/xalan/jars/xalan-2.7.0.jar org.jboss.jsfunit/jboss-jsfunit-core/jars/jboss-jsfunit-core-1.3.0.Final.jar net.sourceforge.htmlunit/htmlunit/jars/htmlunit-2.8.jar xalan/xalan/jars/xalan-2.7.1.jar xalan/serializer/jars/serializer-2.7.1.jar xml-apis/xml-apis/jars/xml-apis-1.3.04.jar commons-collections/commons-collections/jars/commons-collections-3.2.1.jar commons-lang/commons-lang/jars/commons-lang-2.4.jar org.apache.httpcomponents/httpclient/jars/httpclient-4.0.1.jar org.apache.httpcomponents/httpcore/jars/httpcore-4.0.1.jar commons-codec/commons-codec/jars/commons-codec-1.4.jar org.apache.httpcomponents/httpmime/jars/httpmime-4.0.1.jar org.apache.james/apache-mime4j/jars/apache-mime4j-0.6.jar net.sourceforge.htmlunit/htmlunit-core-js/jars/htmlunit-core-js-2.8.jar xerces/xercesImpl/jars/xercesImpl-2.9.1.jar net.sourceforge.nekohtml/nekohtml/jars/nekohtml-1.9.14.jar net.sourceforge.cssparser/cssparser/jars/cssparser-0.9.5.jar org.w3c.css/sac/jars/sac-1.3.jar commons-io/commons-io/jars/commons-io-1.4.jar cactus/cactus/jars/cactus-13-1.7.1.jar cactus/cactus-ant/jars/cactus-ant-13-1.7.1.jar commons-httpclient/commons-httpclient/jars/commons-httpclient-2.0.2.jar junit/junit/jars/junit-3.8.1.jar aspectj/aspectjrt/jars/aspectjrt-1.2.1.jar cargo/cargo/jars/cargo-0.5.jar ant/ant/jars/ant-1.5.4.jar and this is my ivy.xml: <dependencies> <!-- JSF 2.0 RI --> <dependency org="com.sun.faces" name="jsf-api" rev="2.0.0"/> <dependency org="com.sun.faces" name="jsf-impl" rev="2.0.0"/> <!-- MyFaces Orchestra --> <dependency org="org.apache.myfaces.orchestra" name="myfaces-orchestra-core20" rev="1.5-SNAPSHOT"/> <dependency org="org.springframework" name="spring" rev="2.5.6"/> <dependency org="commons-el" name="commons-el" rev="1.0"/> <!-- RichFaces --> <dependency org="org.richfaces.ui" name="richfaces-ui" rev="3.3.3.Final"/> <dependency org="org.richfaces.framework" name="richfaces-impl-jsf2" rev="3.3.3.Final"/> <dependency org="com.sun.facelets" name="jsf-facelets" rev="1.1.14"/> <!-- Hibernate --> <dependency org="org.hibernate" name="hibernate-core" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-c3p0" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.6.0.Final"/> <dependency org="org.hibernate" name="hibernate-search" rev="3.3.0.Final"/> <dependency org="mysql" name="mysql-connector-java" rev="5.1.13"/> <!-- PrettyFaces --> <dependency org="com.ocpsoft" name="prettyfaces-jsf2" rev="3.0.1"/> <!-- SLF4J --> <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/> <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1"/> <!-- XOM --> <dependency org="xom" name="xom" rev="1.2.5"/> <!-- JSF Unit --> <dependency org="org.jboss.jsfunit" name="jboss-jsfunit-core" rev="1.3.0.Final" conf="development"/> </dependencies> I am deploying to tomcat 6.0 Update After the answer below, I solved this by adding the following dependency to my ivy.xml: <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.0.Final"/> then putting this jar above everything else under Eclipse's build order tab. I was using JRE/JDK 6.

    Read the article

  • Hibernate Communications Link Failure in Restlet-Hibernate Based Java application powered by MySQL

    - by Vatsala
    Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i.e. when there are no queries issued to MySQL for more than approximately 6 hours). I am pasting a top 'exception' level description below, and adding a pastebin link for a detailed stacktrace description. javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Cannot open connection - Caused by: org.hibernate.exception.JDBCConnectionException: Cannot open connection - Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure - The last packet successfully received from the server was 1,274,868,181,212 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. - Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure - The last packet successfully received from the server was 1,274,868,181,212 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. - Caused by: java.net.ConnectException: Connection refused: connect the link to the pastebin for further investigation - http://pastebin.com/4KujAmgD What I understand from these exception statements is that MySQL is refusing to take in any connections after a period of idle/nil activity. I have been reading up a bit about this via google search, and came to know that one of the possible ways to overcome this is to set values for c3p0 properties as c3p0 comes bundled with Hibernate. Specifically, I read from here http://www.mchange.com/projects/c3p0/index.html that setting two properties idleConnectionTestPeriod and preferredTestQuery will solve this for me. But these values dont seem to have had an effect. Is this the correct approach to fixing this? If not, what is the right way to get over this? The following are related Communications Link Failure questions at stackoverflow.com, but I've not found a satisfactory answer in their answers. http://stackoverflow.com/questions/2121829/java-db-communications-link-failure http://stackoverflow.com/questions/298988/how-to-handle-communication-link-failure Note 1 - i dont get this error when I am using my application continuosly. Note 2 - I use JPA with Hibernate and hence my hibernate.dialect,etc hibernate properties reside within the persistence.xml in the META-INF folder (does that prevent the c3p0 properties from working?)

    Read the article

  • Spring transactions not committing

    - by Clinton Bosch
    I am struggling to get my spring managed transactions to commit, could someone please spot what I have done wrong. All my tables are mysql InnonDB tables. My RemoteServiceServlet (GWT) is as follows: public class TrainTrackServiceImpl extends RemoteServiceServlet implements TrainTrackService { @Autowired private DAO dao; @Override public void init(ServletConfig config) throws ServletException { super.init(config); WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext()); AutowireCapableBeanFactory beanFactory = ctx.getAutowireCapableBeanFactory(); beanFactory.autowireBean(this); } @Transactional(propagation= Propagation.REQUIRED, rollbackFor=Exception.class) public UserDTO createUser(String firstName, String lastName, String idNumber, String cellPhone, String email, int merchantId) { User user = new User(); user.setFirstName(firstName); user.setLastName(lastName); user.setIdNumber(idNumber); user.setCellphone(cellPhone); user.setEmail(email); user.setDateCreated(new Date()); Merchant merchant = (Merchant) dao.find(Merchant.class, merchantId); if (merchant != null) { user.setMerchant(merchant); } // Save the user. dao.saveOrUpdate(user); UserDTO dto = new UserDTO(); dto.id = user.getId(); dto.firstName = user.getFirstName(); dto.lastName = user.getLastName(); return dto; } The DAO is as follows: public class DAO extends HibernateDaoSupport { private String adminUsername; private String adminPassword; private String godUsername; private String godPassword; public String getAdminUsername() { return adminUsername; } public void setAdminUsername(String adminUsername) { this.adminUsername = adminUsername; } public String getAdminPassword() { return adminPassword; } public void setAdminPassword(String adminPassword) { this.adminPassword = adminPassword; } public String getGodUsername() { return godUsername; } public void setGodUsername(String godUsername) { this.godUsername = godUsername; } public String getGodPassword() { return godPassword; } public void setGodPassword(String godPassword) { this.godPassword = godPassword; } public void saveOrUpdate(ModelObject obj) { getHibernateTemplate().saveOrUpdate(obj); } And my applicationContext.xml is as follows: <context:annotation-config/> <context:component-scan base-package="za.co.xxx.traintrack.server"/> <!-- Application properties --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>file:${user.dir}/@propertiesFile@</value> </list> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${connection.dialect}</prop> <prop key="hibernate.connection.username">${connection.username}</prop> <prop key="hibernate.connection.password">${connection.password}</prop> <prop key="hibernate.connection.url">${connection.url}</prop> <prop key="hibernate.connection.driver_class">${connection.driver.class}</prop> <prop key="hibernate.show_sql">${show.sql}</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.c3p0.min_size">5</prop> <prop key="hibernate.c3p0.max_size">20</prop> <prop key="hibernate.c3p0.timeout">300</prop> <prop key="hibernate.c3p0.max_statements">50</prop> <prop key="hibernate.c3p0.idle_test_period">60</prop> </props> </property> <property name="annotatedClasses"> <list> <value>za.co.xxx.traintrack.server.model.Answer</value> <value>za.co.xxx.traintrack.server.model.Company</value> <value>za.co.xxx.traintrack.server.model.CompanyRegion</value> <value>za.co.xxx.traintrack.server.model.Merchant</value> <value>za.co.xxx.traintrack.server.model.Module</value> <value>za.co.xxx.traintrack.server.model.Question</value> <value>za.co.xxx.traintrack.server.model.User</value> <value>za.co.xxx.traintrack.server.model.CompletedModule</value> </list> </property> </bean> <bean id="dao" class="za.co.xxx.traintrack.server.DAO"> <property name="sessionFactory" ref="sessionFactory"/> <property name="adminUsername" value="${admin.user.name}"/> <property name="adminPassword" value="${admin.user.password}"/> <property name="godUsername" value="${god.user.name}"/> <property name="godPassword" value="${god.user.password}"/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="sessionFactory"/> </property> </bean> <!-- enable the configuration of transactional behavior based on annotations --> <tx:annotation-driven transaction-manager="transactionManager"/> If I change the sessionFactory property to be autoCommit=true then my object does get persisited. <prop key="hibernate.connection.autocommit">true</prop>

    Read the article

  • error initializing multiple configuration files

    - by lurscher
    Hi, during initialization startup on tomcat, the configurations are: 1) a webapp/WEB-INF/web.xml that imports yummy-servlet.xml in contextConfigLocation (although i'm aware that is not required since the servlet-name is yummy it will try to load yummy-servlet.xml by default) 2) a webapp/WEB-INF/yummy-servlet.xml that imports a spring/applicationContext-hibernate.xml file 3) a webapp/WEB-INF/spring/applicationContext-hibernate.xml that imports a applicationContext-dataSource.xml file 4) a webapp/WEB-INF/spring/applicationContext-dataSource.xml i'm getting errors about Failed to import bean definitions from relative location, but the stack trace is not very explicit about exactly what is the problem, i've been looking at these since yesterday and i really don't see any problem on the files my web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>hello-spring3-RC1</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/yummy-servlet.xml</param-value> </context-param> <!-- <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/applicationContext-hibernate.xml</param-value> </context-param> --> <!-- Location of the Log4J config file, for initialization and refresh checks. Applied by Log4jConfigListener. --> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:log4j.properties</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>yummy</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>yummy</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> my yummy-servlet.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <import resource="spring/applicationContext-hibernate.xml"/> <context:component-scan base-package="com.mine.web.controllers"/> <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> </beans> my applicationContext-hibernate.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- import the dataSource definition --> <import resource="applicationContext-dataSource.xml"/> <!-- Configurer that replaces ${...} placeholders with values from a properties file --> <!-- (in this case, Hibernate-related settings for the sessionFactory definition below) --> <context:property-placeholder location="classpath:jdbc.properties"/> <context:property-placeholder location="classpath:hibernate.properties"/> <!-- Hibernate SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:mappingResources="hello.hbm.xml"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop> </props> </property> <property name="eventListeners"> <map> <entry key="merge"> <bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/> </entry> </map> </property> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory"/> <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= --> <!-- Activates various annotations to be detected in bean classes: Spring's @Required and @Autowired, as well as JSR 250's @Resource. --> <context:annotation-config/> <!-- Instruct Spring to perform declarative transaction management automatically on annotated classes. --> <tx:annotation-driven transaction-manager="transactionManager"/> <bean id="EntityManager" class="com.mine.persistence.hibernate.HibernateHelloWorldDao"/> </beans> and my applicationContext-dataSource.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd"> <!-- Configurer that replaces ${...} placeholders with values from a properties file --> <!-- (in this case, JDBC-related settings for the dataSource definition below) --> <context:property-placeholder location="classpath:jdbc.properties"/> <context:property-placeholder location="classpath:hibernate.properties"/> <!-- data source using apache common dbcp pool manager <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}"/>--> <!-- c3p0 pool manager data source --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driverClassName}"/> <property name="jdbcUrl" value="${jdbc.url}"/> <property name="user" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="initialPoolSize" value="${hibernate.c3p0.min_size}"/> <property name="minPoolSize" value="${hibernate.c3p0.min_size}"/> <property name="maxPoolSize" value="${jdbc.maxconn}"/> <property name="idleConnectionTestPeriod" value="150"/> <property name="acquireIncrement" value="1"/> <property name="maxStatements" value="0"/> <property name="numHelperThreads" value="5"/> </bean> </beans> and this is the stack trace: 2010-06-13 12:16:33,526 INFO [org.springframework.web.context.ContextLoader] - < Root WebApplicationContext: initialization started> 2010-06-13 12:16:33,707 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <Refreshing Root WebApplicationContext: startup date [Sun Jun 13 12:16:33 GMT-05:00 2010]; root of context hierarchy> 2010-06-13 12:16:34,086 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from ServletContext resource [/WEB- INF/yummy-servlet.xml]> 2010-06-13 12:16:34,378 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from URL [jndi:/localhost/protoweb/ WEB-INF/spring/applicationContext-hibernate.xml]> 2010-06-13 12:16:34,473 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from URL [jndi:/localhost/protoweb/ WEB-INF/spring/applicationContext-dataSource.xml]> 2010-06-13 12:16:35,098 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring/applicationContext-hibernate.xml] Offending resource: ServletContext resource [/WEB-INF/yummy-servlet.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Un expected exception parsing XML document from URL [jndi:/localhost/protoweb/WEB-INF/spring/applicationContext-hibernate.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/Str ing;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues; at org.springframework.beans.factory.parsing.FailFastProblemReporter.err or(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:197) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:146) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:131) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:91) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe rBeanDefinitions(XmlBeanDefinitionReader.java:475) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB eanDefinitions(XmlBeanDefinitionReader.java:372) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea nDefinitions(XmlBeanDefinitionReader.java:316) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea nDefinitions(XmlBeanDefinitionReader.java:284) at org.springframework.beans.factory.support.AbstractBeanDefinitionReade r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReade r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReade r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.load BeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.load BeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationCon text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127) at org.springframework.context.support.AbstractApplicationContext.obtain FreshBeanFactory(AbstractApplicationContext.java:429) at org.springframework.context.support.AbstractApplicationContext.refres h(AbstractApplicationContext.java:356) at org.springframework.web.context.ContextLoader.createWebApplicationCon text(ContextLoader.java:270) at org.springframework.web.context.ContextLoader.initWebApplicationConte xt(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitiali zed(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContex t.java:3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 467) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77 1) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740 ) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443 ) at org.apache.catalina.core.StandardService.start(StandardService.java:5 19) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710 ) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexp ected exception parsing XML document from URL [jndi:/localhost/protoweb/WEB-INF/ spring/applicationContext-hibernate.xml]; nested exception is java.lang.NoSuchMe thodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String ;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues; at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB eanDefinitions(XmlBeanDefinitionReader.java:394) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea nDefinitions(XmlBeanDefinitionReader.java:316) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea nDefinitions(XmlBeanDefinitionReader.java:284) at org.springframework.beans.factory.support.AbstractBeanDefinitionReade r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReade r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:187) ... 42 more Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropert yValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/Muta blePropertyValues; at org.springframework.transaction.config.AnnotationDrivenBeanDefinition Parser.registerTransactionManager(AnnotationDrivenBeanDefinitionParser.java:95) at org.springframework.transaction.config.AnnotationDrivenBeanDefinition Parser.access$0(AnnotationDrivenBeanDefinitionParser.java:94) at org.springframework.transaction.config.AnnotationDrivenBeanDefinition Parser$AopAutoProxyConfigurer.configureAutoProxyCreator(AnnotationDrivenBeanDefi nitionParser.java:121) at org.springframework.transaction.config.AnnotationDrivenBeanDefinition Parser.parse(AnnotationDrivenBeanDefinitionParser.java:79) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(N amespaceHandlerSupport.java:72) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:1327) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:1317) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:134) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:91) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe rBeanDefinitions(XmlBeanDefinitionReader.java:475) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB eanDefinitions(XmlBeanDefinitionReader.java:372) ... 47 more 06/13/2010 12:16:35 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart

    Read the article

  • How to share connection pool among multiple Java applications

    - by Wilson
    Hi all. I'm implementing several JavaSE applications on single server. Is it possible to setup a single connection pool (e.g. C3P0) and share among these applications? I just want to have an easy way to manage the total number of DB connections. Is there any drawbacks using such centralized connection pool? Thank you, Wilson

    Read the article

  • Hibernate @Transactional not starting transaction

    - by rhinds
    I have a web app using Hibernate, and I am attempting to persist some data, but it is failing to persist within a Transaction despite using the @Transactional annotation. My service class is as follows: @Service("profileService") public class ProfileService { private EntityManager entityManager; @Autowired private AccountService accountService; @Autowired private ProfileDAOImpl profileDao; @PersistenceContext public void setEntityManager(EntityManager em) { this.entityManager = em; } @Transactional public void addConnectionToAccount(SocialConnection sc) { entityManager.persist(sc); } } The addConnectionToAccount() method is being called from another Spring bean in a normal method, and the ProfileService class is currently being injected there: public class HibernateConnectionRepository implements ConnectionRepository { @Inject private ProfileService profileService; @Override @Transactional public void addConnection(SocialConnection sc) { try { profileService.addConnectionToAccount(accountId, sc); } catch (Exception e) { e.printStackTrace(); } } I tried putting the @Transactional annotation on the calling method in the vain hope that it might make a difference but nothing. Previously I have experienced problems like this its been because the object being persisted does not satisfy table restrictions (such as non-nullable columns as null) or because the method is being called from within the same class and the calling method is not Transactional, but neither of those are the case here.. Any ideas? it just fails silently, the logs are as follows: 2012-03-26 22:25:04,702 [http-bio-8085-exec-9] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1bc25c8 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@e5b006) 2012-03-26 22:25:04,710 [http-bio-8085-exec-9] DEBUG org.hibernate.SQL - select SEQ_COUNT from SEQUENCE where SEQ_NAME = 'PO_SEQ' for update 2012-03-26 22:25:04,711 [http-bio-8085-exec-9] DEBUG org.hibernate.SQL - update SEQUENCE set SEQ_COUNT = ? where SEQ_COUNT = ? and SEQ_NAME = 'PO_SEQ' 2012-03-26 22:25:04,723 [http-bio-8085-exec-9] DEBUG com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1bc25c8 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@e5b006) 2012-03-26 22:25:04,723 [http-bio-8085-exec-9] DEBUG org.hibernate.event.internal.AbstractSaveEventListener - Generated identifier: 2200, using strategy: org.hibernate.id.MultipleHiLoPerTableGenerator UPDATE Also wanted to mention that the HibernateConnectionRepository bean is not annotated and is actually being configured in an @Configuration class (if this makes any difference? not used @Configuration classes much). The method to create the bean is as follows: @Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public ConnectionRepository connectionRepository() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in"); } ApplicationUser user = (ApplicationUser) authentication.getPrincipal(); return usersConnectionRepository().createConnectionRepository(String.valueOf(user.getAccountId())); } The bean is scoped to the logged in user, but may also be created multiple times for each user..

    Read the article

  • How to set up hibernate to use Glassfish connection pool?

    - by jschoen
    I have set up a connection pool in Glassfish with a jndi resource for it also setup. I am stumped on how to configure hibernate to go get it. I have come across alot of write ups to configure it to use C3P0 connection pool. Well I am lost. I found that I need to set: hibernate.connection.datasource hibernate.jndi.url hibernate.jndi.class hibernate.connection.username hibernate.connection.password Would datasource be the same as the hibernate.connection.datasource set in the connection pool? What would hibernate.jndi.class be? Are hibernate.connection.username and hibernate.connection.password for the connection to the database or to the appserver? I assume this is to the database, but why do I need them since that is all set in the appserver?

    Read the article

  • Problem using Hibernate-Search

    - by KCore
    Hi, I am using hibernate search for my application. It is well configured and running perfectly till some time back, when it stopped working suddenly. The reason according to me being the number of my model (bean) classes. I have some 90 classes, which I add to my configuration, while building my Hibernate Configuration. When, I disable hibernate search (remove the search annotations and use Configuration instead of AnnotationsConfiguration), I try to start my application, it Works fine. But,the same app when I enable search, it just hangs up. I tried debugging and found the exact place where it hangs. After adding all the class to my AnnotationsConfiguration object, when I say cfg.buildSessionfactory(), It never comes out of that statement. (I have waited for hours!!!) Also when I decrease the number of my model classes (like say to half i.e. 50) it comes out of that statement and the application works fine.. Can Someone tell why is this happening?? My versions of hibernate are: hibernate-core-3.3.1.GA.jar hibernate-annotations-3.4.0.GA.jar hibernate-commons-annotations-3.1.0.GA.jar hibernate-search-3.1.0.GA.jar Also if need to avoid using AnnotationsConfiguration, I read that I need to configure the search event listeners explicitly.. can anyone list all the neccessary listeners and their respective classes? (I tried the standard ones given in Hibernate Search books, but they give me ClassNotFound exception and I have all the neccesarty libs in classpath) Here are the last few lines of hibernate trace I managed to pull : 16:09:32,814 INFO AnnotationConfiguration:369 - Hibernate Validator not found: ignoring 16:09:32,892 INFO ConnectionProviderFactory:95 - Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider 16:09:32,895 INFO C3P0ConnectionProvider:103 - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/autolinkcrmcom_data 16:09:32,898 INFO C3P0ConnectionProvider:104 - Connection properties: {user=root, password=****} 16:09:32,900 INFO C3P0ConnectionProvider:107 - autocommit mode: false 16:09:33,694 INFO SettingsFactory:116 - RDBMS: MySQL, version: 5.1.37-1ubuntu5.1 16:09:33,696 INFO SettingsFactory:117 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.10 ( $Date: 2005/05/19 15:52:23 $, $Revision: 1.1.2.2 $ ) 16:09:33,701 INFO Dialect:175 - Using dialect: org.hibernate.dialect.MySQLDialect 16:09:33,707 INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions) 16:09:33,709 INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 16:09:33,711 INFO SettingsFactory:170 - Automatic flush during beforeCompletion(): disabled 16:09:33,714 INFO SettingsFactory:174 - Automatic session close at end of transaction: disabled 16:09:32,814 INFO AnnotationConfiguration:369 - Hibernate Validator not found: ignoring 16:09:32,892 INFO ConnectionProviderFactory:95 - Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider 16:09:32,895 INFO C3P0ConnectionProvider:103 - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/autolinkcrmcom_data 16:09:32,898 INFO C3P0ConnectionProvider:104 - Connection properties: {user=root, password=****} 16:09:32,900 INFO C3P0ConnectionProvider:107 - autocommit mode: false 16:09:33,694 INFO SettingsFactory:116 - RDBMS: MySQL, version: 5.1.37-1ubuntu5.1 16:09:33,696 INFO SettingsFactory:117 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.10 ( $Date: 2005/05/19 15:52:23 $, $Revision: 1.1.2.2 $ ) 16:09:33,701 INFO Dialect:175 - Using dialect: org.hibernate.dialect.MySQLDialect 16:09:33,707 INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions) 16:09:33,709 INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 16:09:33,711 INFO SettingsFactory:170 - Automatic flush during beforeCompletion(): disabled 16:09:33,714 INFO SettingsFactory:174 - Automatic session close at end of transaction: disabled 16:09:33,716 INFO SettingsFactory:181 - JDBC batch size: 15 16:09:33,719 INFO SettingsFactory:184 - JDBC batch updates for versioned data: disabled 16:09:33,721 INFO SettingsFactory:189 - Scrollable result sets: enabled 16:09:33,723 DEBUG SettingsFactory:193 - Wrap result sets: disabled 16:09:33,725 INFO SettingsFactory:197 - JDBC3 getGeneratedKeys(): enabled 16:09:33,727 INFO SettingsFactory:205 - Connection release mode: auto 16:09:33,730 INFO SettingsFactory:229 - Maximum outer join fetch depth: 2 16:09:33,732 INFO SettingsFactory:232 - Default batch fetch size: 1000 16:09:33,735 INFO SettingsFactory:236 - Generate SQL with comments: disabled 16:09:33,737 INFO SettingsFactory:240 - Order SQL updates by primary key: disabled 16:09:33,740 INFO SettingsFactory:244 - Order SQL inserts for batching: disabled 16:09:33,742 INFO SettingsFactory:420 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 16:09:33,744 INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory 16:09:33,747 INFO SettingsFactory:252 - Query language substitutions: {} 16:09:33,750 INFO SettingsFactory:257 - JPA-QL strict compliance: disabled 16:09:33,752 INFO SettingsFactory:262 - Second-level cache: enabled 16:09:33,754 INFO SettingsFactory:266 - Query cache: disabled 16:09:33,757 INFO SettingsFactory:405 - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge 16:09:33,759 INFO RegionFactoryCacheProviderBridge:61 - Cache provider: net.sf.ehcache.hibernate.EhCacheProvider 16:09:33,762 INFO SettingsFactory:276 - Optimize cache for minimal puts: disabled 16:09:33,764 INFO SettingsFactory:285 - Structured second-level cache entries: disabled 16:09:33,766 INFO SettingsFactory:314 - Statistics: disabled 16:09:33,769 INFO SettingsFactory:318 - Deleted entity synthetic identifier rollback: disabled 16:09:33,771 INFO SettingsFactory:333 - Default entity-mode: pojo 16:09:33,774 INFO SettingsFactory:337 - Named query checking : enabled 16:09:33,869 INFO Version:20 - Hibernate Search 3.1.0.GA 16:09:35,134 DEBUG DocumentBuilderIndexedEntity:157 - Field selection in projections is set to false for entity **com.xyz.abc**. recognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernaterecognized hibernateDocumentBuilderIndexedEntity Donno what the last line indicates ??? (hibernaterecognized....) After the last line it doesnt do anything (no trace too ) and just hangs....

    Read the article

  • How to avoid this very heavy query that slows down the application?

    - by Juan Paredes
    Hi, We have a web application running in a production enviroment and at some point the client complained about how slow the application got. When we checked what was going on with the application and the database we discover this "precious" query that was being executed by several users at the same time (thus inflicting an extremely high load on the database server): SELECT NULL AS table_cat, o.owner AS table_schem, o.object_name AS table_name, o.object_type AS table_type, NULL AS remarks FROM all_objects o WHERE o.owner LIKE :1 ESCAPE :"SYS_B_0" AND o.object_name LIKE :2 ESCAPE :"SYS_B_1" AND o.object_type IN(:"SYS_B_2", :"SYS_B_3") ORDER BY table_type, table_schem, table_name Our application does not execute this query, I believe it is an Hibernate internal query. I've found little information on why Hibernate does this extremely heavy query, so any help in how to avoid it very much appreciated! The production enviroment information: Red Hat Enterprise Linux 5.3 (Tikanga), JDK 1.5, web container OC4J (whitin Oracle Application Server), Oracle Database 10.1.0.4, JDBC Driver for JDK 1.2 and 1.3, Hibernate version 3.2.6.ga, connection pool library C3P0 version 0.9.1. Thank you.

    Read the article

  • How to sett up hibernate to use Glassfish connection pool?

    - by jschoen
    I have set up a connection pool in Glassfish with a jndi resource for it also setup. I am stumped on how to configure hibernate to go get it. I have come across alot of write ups to configure it to use C3P0 connection pool. Well I am lost. I found that I need to set: hibernate.connection.datasource hibernate.jndi.url hibernate.jndi.class hibernate.connection.username hibernate.connection.password Would datasource be the same as the hibernate.connection.datasource set in the connection pool? What would hibernate.jndi.class be? Are hibernate.connection.username and hibernate.connection.password for the connection to the database or to the appserver? I assume this is to the database, but why do I need them since that is all set in the appserver?

    Read the article

  • Should integration testing of DAOs be done in an application server?

    - by HDave
    I have a three tier application under development and am creating integration tests for DAOs in the persistence layer. When the application runs in Websphere or JBoss I expect to use the connection pooling and transaction manager of those application servers. When the application runs in Tomcat or Jetty, we'll be using C3P0 for pooling and Atomikos for transactions. Because of these different subsystems, should the DAO's be tested in a fully configured application server environment or should we handle those concerns when integration testing the service layer? Currently we plan on setting up a simple JDBC data source with non-JTA (i.e. resource-local) transactions for DAO integration testing, thus no application server is involved....but this leaves me wondering about environmental problems we won't uncover.

    Read the article

  • Spring & Hibernate SessionFactory - recovery from a down server

    - by MJB
    So pre spring, we used version of HibernateUtil that cached the SessionFactory instance if a successful raw JDBC connection was made, and threw SQLException otherwise. This allowed us to recover from initial setup of the SessionFactory being "bad" due to authentication or server connection issues. We moved to Spring and wired things in a more or less classic way with the LocalSessionFactoryBean, the C3P0 datasource, and various dao classes which have the SessionFactory injected. Now, if the SQL server appears to not be up when the web app runs, the web app never recovers. All access to the dao methods blow up because a null sessionfactory gets injected. (once the sessionfactory is made properly, the connection pool mostly handles the up/down status of the sql server fine, so recovery is possible) Now, the dao methods are wired by default to be singletons, and we could change them to prototype. I don't think that will fix the matter though - I believe the LocalSessionFactoryBean is now "stuck" and caches the null reference (I haven't tested this yet, though, I'll shamefully admit). This has to be an issue that concerns people.

    Read the article

  • What is an Enterprise Java Bean really?

    - by HDave
    On the Tomcat FAQ it says: "Tomcat is not an EJB server. Tomcat is not a full J2EE server." But if I: use Spring to supply an application context annotate my entities with JPA annotations (and use Hibernate as a JPA provider) configure C3P0 as a connection pooling data source annotate my service methods with @Transactional (and use Atomikos as JTA provider) Use JAXB for marshalling and unmarshalling and possibly add my own JNDI capability then don't I effectively have a JEE application server? And then aren't my beans EJBs? Or is there some other defining characteristic? What is it that a JEE compliant app server gives you that you can't easily/readily get from Tomcat with some 3rd party subsystems?

    Read the article

  • Is it a good idea to close and open hibernate sessions frequently?

    - by Gaurav
    Hi, I'm developing an application which requires that state of entities be read from a database at frequent intervals or triggers. However, once hibernate reads the state, it doesn't re-read it unless I explicitly close the session and read the entity in a new session. Is it a good idea to open a session everytime I want to read the entity and then close it afterwards? How much of an overhead does this put on the application and the database (we use a c3p0 connection pool also)? Will it be enough to simply evict the entity from the session before reading it again?

    Read the article

  • jboss 5.1 mysql connection pooling

    - by boyd4715
    I am using JBOSS 5.1.0.GA, MySQL 5.5 and Hibernate 3.3.1 GA (included with JBOSS) + Spring. My question is do I need to add c3p0 as a data source in my spring/hibernate configuration for connection pooling or are the setting in the JBOSS mysql-ds.xml setting enough. My mysql-ds.xml is the following: <datasources> <local-tx-datasource> <jndi-name>MySqlDS</jndi-name> <connection-url>jdbc:mysql://localhost:3306/ecotrak</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>ecotrak</user-name> <password>ecotrak</password> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>5</idle-timeout-minutes> <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name> <!-- should only be used on drivers after 3.22.1 with "ping" support --> <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> --> <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> --> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>mySQL</type-mapping> </metadata> </local-tx-datasource> </datasources>

    Read the article

  • jdbc4 CommunicationsException

    - by letronje
    I have a machine running a java app talking to a mysql instance running on the same instance. the app uses jdbc4 drivers from mysql. I keep getting com.mysql.jdbc.exceptions.jdbc4.CommunicationsException at random times. Here is the whole message. Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was25899 milliseconds ago.The last packet sent successfully to the server was 25899 milliseconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. For mysql, the value of global 'wait_timeout' and 'interactive_timeout' is set to 3600 seconds and 'connect_timeout' is set to 60 secs. the wait timeout value is much higher than the 26 secs(25899 msecs). mentioned in the exception trace. I use dbcp for connection pooling and here is spring bean config for the datasource. <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource" > <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/db"/> <property name="username" value="xxx"/> <property name="password" value="xxx" /> <property name="poolPreparedStatements" value="false" /> <property name="maxActive" value="3" /> <property name="maxIdle" value="3" /> </bean> Any idea why this could be happening? Will using c3p0 solve the problem ?

    Read the article

  • jdbc4 CommunicationsException

    - by letronje
    I have a machine running a java app talking to a mysql instance running on the same instance. the app uses jdbc4 drivers from mysql. I keep getting com.mysql.jdbc.exceptions.jdbc4.CommunicationsException at random times. Here is the whole message. Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was25899 milliseconds ago.The last packet sent successfully to the server was 25899 milliseconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. For mysql, the value of global 'wait_timeout' and 'interactive_timeout' is set to 3600 seconds and 'connect_timeout' is set to 60 secs. the wait timeout value is much higher than the 26 secs(25899 msecs). mentioned in the exception trace. I use dbcp for connection pooling and here is spring bean config for the datasource. <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource" > <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/db"/> <property name="username" value="xxx"/> <property name="password" value="xxx" /> <property name="poolPreparedStatements" value="false" /> <property name="maxActive" value="3" /> <property name="maxIdle" value="3" /> </bean> Any idea why this could be happening? Will using c3p0 solve the problem ?

    Read the article

  • Hibernate: how to call a stored function returning a varchar?

    - by Péter Török
    I am trying to call a legacy stored function in an Oracle9i DB from Java using Hibernate. The function is declared like this: create or replace FUNCTION Transferlocation_Fix (mnemonic_code IN VARCHAR2) RETURN VARCHAR2 After several failed tries and extensive googling, I found this thread on the Hibernate forums which suggested a mapping like this: <sql-query name="TransferLocationFix" callable="true"> <return-scalar column="retVal" type="string"/> select Transferlocation_Fix(:mnemonic) as retVal from dual </sql-query> My code to execute it is Query query = session.getNamedQuery("TransferLocationFix"); query.setParameter("mnemonic", "FC3"); String result = (String) query.uniqueResult(); and the resulting log is DEBUG (org.hibernate.jdbc.AbstractBatcher:366) - - about to open PreparedStatement (open PreparedStatements: 0, globally: 0) DEBUG (org.hibernate.SQL:401) - - select Transferlocation_Fix(?) as retVal from dual TRACE (org.hibernate.jdbc.AbstractBatcher:484) - - preparing statement TRACE (org.hibernate.type.StringType:133) - - binding 'FC3' to parameter: 2 TRACE (org.hibernate.type.StringType:133) - - binding 'FC3' to parameter: 2 java.lang.NullPointerException at oracle.jdbc.ttc7.TTCAdapter.newTTCType(TTCAdapter.java:300) at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCColumnArray(TTCAdapter.java:270) at oracle.jdbc.ttc7.TTCAdapter.createNonPlsqlTTCDataSet(TTCAdapter.java:231) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1924) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:850) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2599) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:736) at com.mchange.v2.c3p0.impl.NewProxyCallableStatement.execute(NewProxyCallableStatement.java:3044) at org.hibernate.dialect.Oracle8iDialect.getResultSet(Oracle8iDialect.java:379) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:193) at org.hibernate.loader.Loader.getResultSet(Loader.java:1784) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811) at com.my.project.SomeClass.method(SomeClass.java:202) ... Any clues what am I doing wrong? Or any better ways to call this stored function?

    Read the article

  • What is the best practice for including third party jar files in a Java program?

    - by ZoFreX
    I have a program that needs several third-party libraries, and at the moment it is packaged like so: zerobot.jar (my file) libs/pircbot.jar libs/mysql-connector-java-5.1.10-bin.jar libs/c3p0-0.9.1.2.jar As far as I know the "best" way to handle third-party libs is to put them on the classpath in the manifest of my jar file, which will work cross-platform, won't slow down launch (which bundling them might) and doesn't run into legal issues (which repackaging might). The problem is for users who supply the third party libraries themselves (example use case, upgrading them to fix a bug). Two of the libraries have the version number in the file, which adds hassle. My current solution is that my program has a bootstrapping process which makes a new classloader and instantiates the program proper using it. This custom classloader adds all .jar files in lib/ to its classpath. My current way works fine, but I now have two custom classloaders in my application and a recent change to the code has caused issues that are difficult to debug, so if there is a better way I'd like to remove this complexity. It also seems like over-engineering for what I'm sure is a very common situation. So my question is, how should I be doing this?

    Read the article

  • How can I find the jdbc connection timeout of a hibernate session

    - by StevenWilkins
    I currently have a long running thread which uses a hibernate session to perform many updates. We currently have our c3p0 connection timeout set to 20 minutes and it's timing out sometimes because of the number of updates we're performing. The solution I have is to periodically return the connection to the pool via closing the session (we have hibernate configured this way) and get a new one. Upping the timeout is not desirable because the same pool is used for the entire application. The problem is I don't know when to return the connection to the pool because I don't know what the timeout of the connection is. I know what the current setting is in our property file, but that can be changed without my knowledge at any time so it's fragile. Having a counter and returning the connection based on the number of updates I've performed is not ideal but could be my option of last resort. I have a hibernate session, how can I retrieve the connection timeout of the jdbc connection which backs the session? Using the SessionFactory and SessionFactoryImpl classes are perfectly acceptable.

    Read the article

  • after assembling jar - No Persistence provider for EntityManager named ....

    - by alabalaa
    im developing a standalone application and it works fine when starting it from my ide(intellij idea), but after creating an uberjar and start the application from it javax.persistence.spi.PersistenceProvider is thrown saying "No Persistence provider for EntityManager named testPU" here is my persistence.xml which is placed under meta-inf directory: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>test.model.Configuration</class> <properties> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.password" value="root"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/> <property name="hibernate.c3p0.timeout" value="300"/> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> and here is how im creating the entity manager factory: emf = Persistence.createEntityManagerFactory("testPU"); im using maven and tried the assembly plug-in with the default configuration fot it, i dont have much experience with assembling jars and i dont know if im missing something, so if u have any ideas ill be glad to hear them

    Read the article

  • How to set up default schema name in JPA configuration?

    - by Roman
    I found that in hibernate config file we could set up parameter hibernate.default_schema: <hibernate-configuration> <session-factory> ... <property name="hibernate.default_schema">myschema</property> ... </session-factory> </hibernate-configuration> Now I'm using JPA and I want to do the same. Otherwise I have to add parameter schema to each @Table annotation like: @Entity @Table (name = "projectcategory", schema = "SCHEMANAME") public class Category implements Serializable { ... } As I understand this parameter should be somewhere in this part of configuration: <bean id="domainEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="JiraManager"/> <property name="dataSource" ref="domainDataSource"/> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="generateDdl" value="false"/> <property name="showSql" value="false"/> <property name="databasePlatform" value="${hibernate.dialect}"/> </bean> </property> </bean> <bean id="domainDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${db.driver}" /> <property name="jdbcUrl" value="${datasource.url}" /> <property name="user" value="${datasource.username}" /> <property name="password" value="${datasource.password}" /> <property name="initialPoolSize" value="5"/> <property name="minPoolSize" value="5"/> <property name="maxPoolSize" value="15"/> <property name="checkoutTimeout" value="10000"/> <property name="maxStatements" value="150"/> <property name="testConnectionOnCheckin" value="true"/> <property name="idleConnectionTestPeriod" value="50"/> </bean> ... but I can't find its name in google. Any ideas?

    Read the article

  • Connection hangs after time of inactivity

    - by Sinuhe
    In my application, Spring manages connection pool for database access. Hibernate uses these connections for its queries. At first glance, I have no problems with the pool: it works correctly with concurrent clients and a pool with only one connection. I can execute a lot of queries, so I think that I (or Spring) don't leave open connections. My problem appears after some time of inactivity (sometimes 30 minutes, sometimes more than 2 hours). Then, when Hibernate does some search, it lasts too much. Setting log4j level to TRACE, I get this logs: ... 18:27:01 DEBUG nsactionSynchronizationManager - Retrieved value [org.springframework.orm.hibernate3.SessionHolder@99abd7] for key [org.hibernate.impl.SessionFactoryImpl@7d2897] bound to thread [http-8080-Processor24] 18:27:01 DEBUG HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@8878cd] for Hibernate transaction 18:27:01 DEBUG HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@1b2ffee] 18:27:01 DEBUG HibernateTransactionManager - Creating new transaction with name [com.acjoventut.service.GenericManager.findByExample]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 18:27:01 DEBUG HibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@8878cd] 18:27:01 TRACE SessionImpl - setting flush mode to: AUTO 18:27:01 DEBUG JDBCTransaction - begin 18:27:01 DEBUG ConnectionManager - opening JDBC connection Here it gets frozen for about 2 - 10 minutes. But then continues: 18:30:11 DEBUG JDBCTransaction - current autocommit status: true 18:30:11 DEBUG JDBCTransaction - disabling autocommit 18:30:11 TRACE JDBCContext - after transaction begin 18:30:11 DEBUG HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [jdbc:oracle:thin:@212.31.39.50:30998:orcl, UserName=DEVELOP, Oracle JDBC driver] 18:30:11 DEBUG nsactionSynchronizationManager - Bound value [org.springframework.jdbc.datasource.ConnectionHolder@843a9d] for key [org.apache.commons.dbcp.BasicDataSource@7745fd] to thread [http-8080-Processor24] 18:30:11 DEBUG nsactionSynchronizationManager - Initializing transaction synchronization ... After that, it works with no problems, until another period of inactivity. IMHO, it seems like connection pool returns an invalid/closed connection, and when Hibernate realizes that, ask another connection to the pool. I don't know how can I solve this problem or things I can do for delimiting it. Any help achieving this will be appreciate. Thanks. EDIT: Well, it finally was due a firewall rule. Database detects the connection is lost, but pool (dbcp or c3p0) not. So, it tries to query the database with no success. What is still strange for me is that timeout period is very variable. Maybe the rule is specially strange or firewall doesn't work correctly. Anyway, I have no access to that machine and I can only wait for an explanation. :(

    Read the article

< Previous Page | 1 2 3  | Next Page >