database « Connection « JPA Q&A





1. Keep DB connection using JPA/Hibernate    stackoverflow.com

I am using JPA and Hibernate in an application. (with PostgreSQL as DBMS) I execute a lot of select-statements to get items stored in the DB by their name. I use the following ...

2. Database connection pool and database connection?    stackoverflow.com

I have created a desktop application and I have connect it to a MySQL database with a database connection (bean/class) and I can CRUD. I have seen on the NetBeans ...

3. hibernate, server specific configuration    stackoverflow.com

we have two different environments (test and production), each with it's own database connection. The database connection is configured in the hibernate.cfg.xml, together with the mappings etc. The hibernate.cfg.xml is part of the ...

4. jpa doesn't see table in db    stackoverflow.com

When I execute @NamedQuery(name = "GroupsHasStudent.findByGroupsidGroups", query = "SELECT g FROM GroupsHasStudent g WHERE g.groupsHasStudentPK.groupsidGroups = :groupsidGroups"), of GroupsHasStudent entity, the result is generated correct. But another NativeQuery

getEntityManager().
     ...

5. Multiple Database Connections with Hibernate 3    coderanch.com

I'm using Hibernate 3.0 with MySql 4.1. I have created one session-factory in the hibernate.cfg.xml to connect to my database and my code is working. How does my code need to change if I add another session-factory/database connection? I currently am using a class called HibernateUtil to access the Session, the code is below. How do things work if I have ...

6. multiple DB connections using hibernate    coderanch.com

Hi, If you want to manage transaction for all databases, can you do that with Hibernate? For instance, I want to update data on both databases, but the first transaction on a DB has to be rollback after second transaction on the other DB fails. How can you handle this kind scenario? Thanks in advance. Brad [ January 15, 2008: Message ...

7. Database connection in hibernate    coderanch.com

We specify the Database connection in hibernate.cfg.xml file. Is this file loaded when we start the server? Does the application connect to the database only once during startup , or each time we perform the CRUD operations.I mean is there a opening and closing of a database connection each time we perform an operation on the database.

8. Determine if db-connection fails    forum.hibernate.org

Hi, i'd like do know if the db connection could be established when my program starts up. I thought I can just handle the exception in the class "HibernateUtil" while creating the session factory but unfortunately it doesn't work. Hibernate throws a nested exception and i can't catch it. There must be a better way to check the connection-state than performing ...

9. How to configure a external connection to DataBase?    forum.hibernate.org

Hello fellows, i am not sure if this is the correct area to post this... I've looked for google how to do this, but dont find anything to help me... What I wanna do is simple... I need my DataBase paramters (database name, login, password) out of the application, coz the user usually change his database server, and user account. Is ...





10. Create connections to multiple databases    forum.hibernate.org

Hi, I have an application that uses Spring and Hibernate to connect to a database, but now I need my application site can connect to the database that you can select the user, which means you can create connections to databases per session and not per application site . EntityManagerFactory would need to implement? Thank you for your help Manolo

11. Database connection    forum.hibernate.org

Hi, I am having some problems with my SessionFactory settings. I am trying to create a connection to a local MySQL database and i am getting the following error: "Could not find DataSource". After that i receive an exception. I'm using the latest version of Hibernate as standalone, not connected to any J2EE container. I am using XML as configuration file, ...

12. Restoring connection to database.    forum.hibernate.org

Let we have jboss running on the server and deployed application (based on Hibernate) working with some database server. Suppose system administrator has rebooted database server (but not jboss, or another appserver). Is there way to "transparent" restore cottection to database after reboot, without redeploy and server restart? Does hibernate support this feature, or how can I obviously reset Hibernate's database ...

14. Running out of pooled DB connections    forum.hibernate.org

Hello, I am running out of pooled database connections, despite what I think it proper use of openSession/close and reconnect/disconnect. I am using Hibernate 2.1.1 and DBCP that comes with it. My Hibernate Session operations are as follows: 1. request comes in, I get existing session for the user if I have one, or get a new one via SessionFactory's openSession() ...

15. multiple Configuration objects sharing same DB connections    forum.hibernate.org

We are developing a set of applications in Eclipse that share the same database connection. However, each application sees its own set of Hibernate mapping files. Say, a calendar application might see its own mappings plus the ones from an address book application. Yet another app might also see the address book mappings. You get the idea. My question is: is ...

16. Database cannot set connection option SET_READONLY_FALSE    forum.hibernate.org

Im trying to migrate an application from Websphere 4.0 to Tomcat 4.1 Everything works ok, but when i try to access the database using hibernate i get this error 2004-07-19 15:42:01,267 WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Warning: 0, SQLState: 010SK 2004-07-19 15:42:01,268 WARN net.sf.hibernate.util.JDBCExceptionReporter - 010SK: Database cannot set connection option SET_READONLY_FALSE. im using exact the same driver (jConnect 5.2. ive tried ...





17. Database connections are not returning to connection pool    forum.hibernate.org

Problem : Dear All, We are using JBoss3.2.3, Hibernate2.1.4 and mysql4.0.18. Now our application was at Production. I assume each hibernate session will get one datasource connection from pool and whenever session is closed the datasource connection will returned to pool. (Please Highlight if my assumption is wrong) Normally our application is working fine. But some times after closing session, connections ...

18. ODBC connection to paradox db    forum.hibernate.org

I try to connect with hibernate to a paradox database through the ODBC-JDBC Bridge. I connected the db successfiully in the DB explorer and generated the hibernate files. If I run the application (on JBoss 3.0), I get a "net.sf.hibernate.JDBCException: Cannot open connection" error, caused by "[Microsoft][ODBC Paradox Driver] optional feature not implemented". With that information, I did a ODBC trace, ...

19. Problem with database connection    forum.hibernate.org

Hibernate version: 2.0.3 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: 2004-09-29 08:47:19,353 DEBUG [net.sf.hibernate.transaction.JDBCTransaction] begin 2004-09-29 08:47:19,354 DEBUG [net.sf.hibernate.impl.SessionImpl] loading [org.jboss.nukes.core.themes.themeAlter.Image#1] 2004-09-29 08:47:19,354 DEBUG [net.sf.hibernate.impl.SessionImpl] attempting to resolve [org.jboss.nukes.core.themes.themeAlter.Image#1] 2004-09-29 08:47:19,354 DEBUG [net.sf.hibernate.impl.SessionImpl] resolved object in session cache [org.jboss.nukes.core.themes.themeAlter.Image#1] 2004-09-29 08:47:19,354 DEBUG [net.sf.hibernate.transaction.JDBCTransaction] commit 2004-09-29 08:47:19,354 DEBUG [net.sf.hibernate.impl.SessionImpl] flushing session 2004-09-29 08:47:19,354 DEBUG ...

20. Handling / preventing broken DB-Connections    forum.hibernate.org

Hi, I know, that this problem has come up now and then in this forum already, whoever I found nothing matching the annoying behaviour, that I try to fix the last 2 days. Background: We are running a Webapplication under Tomcat5, using Hibernate, C3P0 and MaxDB. Tomcat and MaxDB are on different servers. Normal operation works fine, but the application is ...

22. Progress DB connection thru Hibernate.    forum.hibernate.org

HI, I am using Progress 9.1D. Whenever I try to establish a DB connection with Progress Database which I named as TestSports using URL JdbcProgress:T:localhost:3030:TestSports it gives me an error: Error trying to connect to database. Check ur URL. I am using myEclipse as a tool to connect with Progress DB using Hibernate. I tried to connect to the Progress Database ...

23. DataSource problem:How can i specify the specific database?    forum.hibernate.org

I use MS SQL Server 2000 as database. My Tomcat5.0 deployment is as below: Data Source URL: jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=Hibernate (This is the database name which i want to specify) JDBC Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver But when i run my hibernate examples,it shows:net.sf.hibernate.JDBCException: Could not save object I try to copy the tables into the MS SQL Server 2000 default database:Northwind. Then i run ...

24. whole app don't work with db connection pooling    forum.hibernate.org

Hello, i have a application with a lot of unit test and everythings running fine whe i used the hibernate-build-in connection pool. If i switch to c0p3 or proxool i get a lot of (connection unrelated) Exceptions, like: (1) org.hibernate.StaleStateException: Unexpected row count: 0 expected: 1 at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:27) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2291) ... (2) null id in com.ms.model.user.Group entry at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48) at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150) ...

25. Using more than one database in datasource    forum.hibernate.org

26. Hibernate database connection inactive    forum.hibernate.org

Hey there, I am having a problem where the database connection dies after a certain period of inactive time and I receive the below error message. Any thoughts? Using: Tomcat 5.5.17, JRE 1.6, MySQL 5.0.24 Mar 2, 2007 7:22:43 AM org.hibernate.transaction.JDBCTransaction commit SEVERE: JDBC commit failed com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Communications link failure during commit(). Transaction resolution unknown. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888) at com.mysql.jdbc.Connection.commit(Connection.java:2285) at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139) ...

27. Connections could not be acquired from the underlying DB!    forum.hibernate.org

Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message adamgibbons Post subject: Connections could not be acquired from the underlying DB! Posted: Sun Apr 22, 2007 12:20 am Senior Joined: Sat Apr 21, 2007 11:01 pm Posts: 144 Hi there, I was wondering if anyone ...

28. Connection pooling and database down    forum.hibernate.org

29. Handle database connection issues    forum.hibernate.org

Newbie Joined: Mon Mar 24, 2008 12:33 pm Posts: 3 Hibernate version: 3.2.6 Hibernate configuration: com.mysql.jdbc.Driver jdbc:mysql://localhost/db1 user pass yes utf8 1 ...

30. Database cannot set connection option SET_CATALOG    forum.hibernate.org

Hi, I'm using Hibernate3 with Sybase (jconnect3) with c3p0 for connection pooling. When I run the application, I get the following message: Code: 2188 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] INFO com.mchange.v2.c3p0.SQLWarnings -010SK: Database cannot set connection option SET_CATALOG. java.sql.SQLWarning: 010SK: Database cannot set connection option SET_CATALOG. at com.sybase.jdbc3.jdbc.ErrorMessage.createWarning(Unknown Source) at com.sybase.jdbc3.jdbc.ErrorMessage.raiseWarning(Unknown Source) at com.sybase.jdbc3.jdbc.MdaManager.getMetaDataAccessor(Unknown ...

31. Sudden database connection problem    forum.hibernate.org

Dear Hibernate users, I've got a really weird Hibernate problem and I'm hoping that one of you has any ideas on how I could solve it. I'm using Hibernate 3.2.6, MySQL Server 5.0.51a and Sun Java System Application Server 9.1.01 with NetBeans 5.5.1 The problem is that I can't connect to the database. When I try to do any kind of ...

32. How to keep database connection alive for production server    forum.hibernate.org

Hi All, I am using hibernate,Mysql and JBOSS server,i want to know how can i keep the database connection alive,i would communication link failure error after some period of time, I am sing c3p0 ,but it dint helped me out. Can anyone say what configuration i should do to set for production. Thankx

33. how to keep database connection alive?    forum.hibernate.org

Hi All, I am using hibernate,Mysql and JBOSS server,i want to know how can i keep the database connection alive,i would communication link failure error after some period of time, I am sing c3p0 ,but it dint helped me out. Can anyone say what configuration i should do to set for production. I have used c3p0 to query the db,these r ...

34. Access to DB Connection    forum.hibernate.org

I have treid with: SessionFactoryImpl session = (SessionFactoryImpl) getSession().getSessionFactory(); return session.getSettings().getConnectionProvider().getConnection(); in jsp i take the connection, execute the query and build the list. after i can't do nothing because i have this exception: javax.servlet.ServletException: com.XXXX.utils.ejb.DaoException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, ...

35. problems with many connections to a database server    forum.hibernate.org

Hibernate version: 3 Code between sessionFactory.openSession() and session.close(): various Name and version of the database you are using: MySQL 5.0.67 I wrote a web application in JSF that uses Hibernate as a persistence layer. This is a web-based "front end" for a database, so it communicates with the db server extensively. It is being run on Apache Tomcat. My problem is ...

36. Hibernate Database Connection Status    forum.hibernate.org

Hi, I'am using Hibernate 3.1.3 for for database interaction. I'am using c3p0 for connection pool strategy. I have a problem whenever we stop the database, we get exception, HiberbateException when operating on session objects, like say on session.createQuery() method. When the database connection is lost, I wish to check the exception if it occurred because of disconnection from database and customize ...

37. how-to handle direct db connection in some case    forum.hibernate.org