application « Session « JPA Q&A





1. Combining Two Applications Kills the SessionFactory?    forum.hibernate.org

We've been trying to combine two long-running applications of ours into a single application. The applications use Hibernate 3, ehcache 1.2, and Spring Framework 1.2.5. The combined application starts out just fine, but when a user moves from the "first" application to a page from the "second" application a few things happen in quick sequence. The first and probably root issue ...

2. Putting the SessionFactory in my application: good idea?    forum.hibernate.org

When setting up my first test Hibernate/Tomcat application, I've noticed that the servlet takes a measurable amount of time (1.5 sec) to read my mapping files and configure itself. I'm thinking I'll put my SessionFactory in the application scope and handle its initalization in my servlet's init() method; is this a good idea or is it a trap? Thanks in advance... ...

3. One session for the whole application    forum.hibernate.org

I have a fat client and I'm using one session for the whole application. I disconnect the session when I'm done with it. However, any time there is an exception or if I wanna do something with a new thread. It creates another sessions by itself and then I get the error that says the object is associated under more then ...

4. session-per-application in a rich client an antipattern?    forum.hibernate.org

I've searched the boards for a while and seen a few posts alluding to the same issue but never a conclusive answer. The application - swing rich client on a single user local db. In this situation I think a session-per-application is desirable. If I load an entity, say the contact "Tom Hughes", I want only one object instance for that ...

5. When to close session on a J2EE application    forum.hibernate.org

In our J2EE application, should we everytime we perform a hibernate request close the session? For instance, should we close it in the finally block, like in this code: Code: public KategoriData getKategoriById(String id) throws BaatkatalogenException { if (id == null) throw new BaatkatalogenException("id er null"); Session session ...

6. How can I close SessionFactory when undeploying application?    forum.hibernate.org

I am using hibernate in a JSP application deployed in Tomcat. In Postgres I see that I tend to acumulate a lot of idle connections when developing my application. I figured out that I am creating 2 connections in my C3p0 managed connection pool on each deplyoment, which remain idle (and inaccessible) after I redeploy the application. Because I'm using a ...

7. my application anomoly with hibernate session.update    forum.hibernate.org

After reading as much documentation as possible, and forums and google, I cannot come up with an answer to this problem. I have an object that uses assigned key for identifier. I have used the version tag to identify whether this is a save or update command. All of this works correctly in hibernate the way it is documented... I would ...

8. only one session for entire application    forum.hibernate.org

Hi all, I have been struggling with lazy loading exceptions. I am developing desktop application, so open session in view filter is not applicable to me. I thought that, i can open the session at the start of the program and close when the program ends. Every save/update is flushed-commited. Every query result objects are refreshed by calling refresh() on every ...

9. How many SessionFactory i can use in one application?    forum.hibernate.org

The SessionFactory and Resource Allocation The SessionFactory itself is a fairly resource intensive object to create. In the first few Hibernate tutorials on this website, we'll typically create SessionFactory objects whenever we need them, but in practice, it is imperative to control how often the SessionFactory gets created. Minimizing the number of SessionFactory objects you create can be done by perhaps ...