Sign Up

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

Have an account? Sign In

Have an account? Sign In Now

Sign In

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

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

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

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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

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

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

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

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

Mobile menu

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:05:09+00:00 2026-05-28T22:05:09+00:00

I am using Glassfish 3.1, JEE6 JPA Annotations, Hibernate provider and Derby database in

  • 0

I am using Glassfish 3.1, JEE6 JPA Annotations, Hibernate provider and Derby database in my (simple) application. I seem to be having a lot of difficulties with connection pooling. Basically, my application worked fine without security, but now that I’ve create a security realm, I’m finding that I run of of connections no matter what size I set the pool to. Obviously, there is something that I’m doing in my code that means the connection is not being returned to the pool after the servlet request finishes.

I’ve seen various posting and advice on StackOverflow and have tried them all…nothing seems to work.

What I would like to know is this…How do I get logging and trace information out of Glassfish? I need to find out why it is not returning the connection to the pool. This way I hope to be able to find the source of the problem.

Many thanks!

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

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:05:09+00:00Added an answer on May 28, 2026 at 10:05 pm

    Its always the first guess, that connections are not returned to the pool due to lack of cleaning up.

    Make sure that:

    • close all connections you open
    • close all EntityManagers that you used

    in every Path.

    It is good practice, do

    use

    try
    {
      //open
      //work
    }
    catch
    {
      //exception handling
    }
    finally
    {
      //close
    }
    

    anywhere where you handle those situations.

    Side Note:
    Static Analyzers like findbugs/sonar are able to detect those situations.

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

Sidebar

Related Questions

Using Glassfish 3.1 with Eclipselink as JPA provider on board. Got stateless bean with
I am using Glassfish v2, Hibernate with Annotations+EntityManager and Postgresql 8.4. I am also
I have created a simple java web (Vaadin) application project using JPA and it
We deploy web services implemented by using the CXF framework on the Glassfish application
I am using Glassfish 3.1.1 and hibernate 3.6.5 with MySQL 5.1 + mysql-connector-java-5.1.6 Intermittently
I'm developing a JSF2 application using Glassfish which contains some EJB's; is there a
I've created a JEE6 web design using glassfish as the container and runtime enviornment,
I am using Glassfish 2 and container managed persistence with Hibernate 3.2 as persistence
We are using Glassfish server 2.1 with Eclipselink JPA 2.1 and connect to a
I have developed a java web application using JSF 2.0(Facelets) on GlassFish 3.1.1 with

Explore

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

Footer

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

Insert/edit link

Enter the destination URL

Or link to existing content

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