connection « Query « JPA Q&A





1. JPA (and/or Hibernate) - How to set timeout threshold for connection and/or query?    stackoverflow.com

I'm trying to figure out how to configure my project such that JPA will timeout and throw an exception after a configured amount of time. There are two situations where I ...

2. How can I find the jdbc connection timeout of a hibernate session    stackoverflow.com

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 ...

3. iReport, use SQL instead HQL query with an hibernate connection    stackoverflow.com

i'm writing a query that need UNION and hql doesn't support it. So the only workaround is to use standrad SQL query but the problem is i can't use it in ...

4. Keep getting org.hibernate.exception.JDBCConnectionException: could not execute query    stackoverflow.com

I've got a J2EE application which uses JSP pages as front end and Struts2 as controller. I also use Hibernate to map my objects into a MySql DB. when I deploy ...

5. Getting org.hibernate.exception.JDBCConnectionException: could not execute query even through JNDI    stackoverflow.com

I use Struts2+JSP+Tomcat6+Hibernate+Mysql as my J2EE application framework.Following to this topic, I've had the problem of getting this error:

org.hibernate.exception.JDBCConnectionException: could not execute query
It appears to be due to the fact ...

6. Hibernate could not execute query due to connection closed in Oracle 11g    stackoverflow.com

This must now be new but not able to find the cause for this. Can anyone please help me to know why connections are getting closed in hibernate. I am using ...

7. How to configure c3p0 in hibernate to auto-refresh stale DB connections    stackoverflow.com

I am using hibernate 3, c3p0 9.1.2, Oracle 11g in my application. If I restart the Oracle then the stale connections are not getting refresh and I am getting exception "java.sql.SQLRecoverableException: ...

8. is another connection needed for "non-hibernate" query?    forum.hibernate.org

ringerc Post subject: Re: is another connection needed for "non-hibernate" query? Posted: Sat Dec 19, 2009 4:59 am Beginner Joined: Mon Dec 14, 2009 12:26 am Posts: 23 Run your query through Hibernate, using the native query interface. Alternately, you can get the underlying JDBC connection from a Session object via Session.connection() ... though this won't work if you're ...

9. JBOSS and Hibernate: Connections In Use Count    forum.hibernate.org





10. Direct sql query from connection causes "Thread Death&q    forum.hibernate.org

Hi all, We are running hibernate 2.0 in Jboss as a SAR. We would be much obliged for any help fixing the problem in our code that results in "thread death". In the part of our code that builds generic read only tabular reports , we are executing direct sql instead of object / relational persistence (please see below) Sometimes, this ...

11. Refresh hibernate connection -- reload data from database    forum.hibernate.org

Hello all, I have java GUI application which uses hibernate to load all data from database. Once the application is executed, it loads all required data from database to java application and diplays data on java GUI. But now if someone adds data directly in database through other third party application, the Java GUI application doesn't reflect those changes. To view ...

12. NPE in AbstractBatcher during query (null connection)    forum.hibernate.org

I am migrating to Hibernate 3.1 and getting a NPE when doing a simple query (a Find All, with no where clause). I've traced the problem in the source and see that the issue is a null connection, which in turn comes from a connectionManager.getConnection() call. My question is why would this ever throw a NPE, and how can I debug ...

13. oracle listener refuses connection after successful queries    forum.hibernate.org

My problem is that the query works fine for about 10 to 20 concurrent requests than the connection to the database is no longer available. Then the context has to be reloaded to make it work again. I have tried using c3p0 and the hibernate connection pooling with about the same results. Playing with the max_size and min_size arguments of c3p0 ...

14. No db connection close after select exception?    forum.hibernate.org

I don't know yer. I went through spring related code, but failed to find how it handles sql exception and related session behaviour. I went to hibernate code and I did find it close conneciton and throws hibernateexception if there is a sqlexception. I have posted an article in spring forum for how handling hibernateexception in spring. Let us wait to ...

15. Intermittent connection problems on page refresh?    forum.hibernate.org

Hi All, using hibernate in a current project (running over Tomcat with mySQL) and everything is going well, almost too well (within eclipse). However, when i deploy as a war i'm getting an issue with db connections. When the war is deployed, page calls give intermittent exceptions like the one below. With a couple of page refreshes everything looks fine, leave ...

16. Connection, Session Closed But SQL Query gets executed?    forum.hibernate.org

Session session = null; PreparedStatement ps = null; ResultSet rs = null; try { Configuration configuration = new Configuration(); SessionFactory sessionFactory = configuration.configure().buildSessionFactory(); session = sessionFactory.openSession(); String query = "select * from trade"; Connection connection = session.connection(); ps = connection.prepareStatement(query); connection.close();//Inspite of this line, the lines below are working fine!! session.close(); //Inspite of this line, the lines below are working fine!! ...





17. Connection Error in criteria Query    forum.hibernate.org

Newbie Joined: Fri Nov 17, 2006 12:18 pm Posts: 6 Hello, I'm working with hibernate within jBoss using a .har file descriptor and everything works just fine except a criteria query i am trying to make.I get a weird connection error, posted below Hibernate version: 3.2 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: ...

18. Can't execute query, connection timed out    forum.hibernate.org

Author Message t_a_chen Post subject: Can't execute query, connection timed out Posted: Sat Dec 09, 2006 2:27 pm Newbie Joined: Sat Dec 09, 2006 1:56 pm Posts: 3 I run into this urgent showstopper with a query hanging for minutes and eventually a connection time out exception is thrown. This is a struts/spring/hibernate application running on WAS 6.1, with ...

19. how can i find out connection status?    forum.hibernate.org

Hibernate version:3.2.0.cr1 hi all, i'd like to display an error page that says database server is down. doing that, i'm planning to write a filter that listens all requests and asks my HibernateUtil the database connection, and if the database server is down, the filter redirects request to the error page. so i modified the ordinary HibernateUtil class's static block and ...

20. Cannot open connection on threaded em.createQuery    forum.hibernate.org

pan.pur@gmail.com Post subject: Posted: Tue Apr 08, 2008 10:03 pm Newbie Joined: Mon Apr 07, 2008 11:46 pm Posts: 4 Code: INFO | jvm 1 | 2008/04/07 15:12:46 | 15:12:46,062 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null INFO | jvm 1 | 2008/04/07 15:12:46 | 15:12:46,062 ERROR [JDBCExceptionReporter] ...

21. Use Hibernates sql connection for queries without Hibernate?    forum.hibernate.org

Is the following possible and save: (1) I use OSIV, with a single transaction / session per request, I implement this with a servlet filter. (2) I implement my own ConnectionProvider, which retrieves a java.sql.Connection from a datasource. Now my question is, can I safely execute queries on the same java.sql.Connection through plain JDBC (without Hibernate) (in the same transaction Hibernate ...

22. Query for select data from oracle thin database connection.    forum.hibernate.org

Newbie Joined: Fri Jul 25, 2008 4:34 am Posts: 4 /*****Hibernate.cfg.xml**************** org.hibernate.dialect.Oracle9Dialect oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@172.16.31.25:1521:BOMBAY poonam poonam true //**********contact.hbm.xml**********

23. MySQL connections count    forum.hibernate.org

Hi everyone: I'm using Hibernate 3.2.5 with MySql 5.1. I'm building a Web app using J2EE and Tomcat. I put in a servlet the next test code Session sesion = HibernateUtil.getSessionFactory().openSession(); sesion.beginTransaction(); Usuario usr = new Usuario(); UsuarioHome usrDal = new UsuarioHome(); usr = usrDal.findById("ff8081811dd7e638011dd7e76b910002", sesion); sesion.getTransaction().commit(); This works prefectly, the problem is that, when I see the MySQL Administrator Client ...

24. Could not obtain connection to query metadata (MySQL)    forum.hibernate.org

Newbie Joined: Thu Sep 24, 2009 2:12 pm Posts: 2 Hello friends. I'm an experienced Java programmer, but never had used the hibernate, this is my first time with it. I've got tired of searching solutions for my problem, and with no success. I hope some other can help me fix this problem. I'm running JDK 5 in eclipse (no plugins), ...