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 6093169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:31:46+00:00 2026-05-23T12:31:46+00:00

We are using Glassfish server 2.1 with Eclipselink JPA 2.1 and connect to a

  • 0

We are using Glassfish server 2.1 with Eclipselink JPA 2.1 and connect to a PostgreSQL database 8.4.8.
The problem is that in the log file of Postgres I always see a prepare of the statements that were created with em.createQuery or em.createNamedQuery.
It seems that no statement that has been prepared is reused. Therefore the performance is really bad.

I tried setting the default JDBC setting prepareThreshold from 5 to 1.
That only changed that the unnamed statements were now named. But they were still not reused.

I also tried several settings for the connection pooling as prepared statements are connection dependent but returned to the default org.postgresql.ds.PGSimpleDataSource and javax.sql.DataSouce.

I enabled statement caching also in the persistence.xml:

<property name="eclipselink.jdbc.cache-statements" value="true"/>

Does Glassfish 2.1 support statement caching? And if it does what are the settings I missed?

Any hints appreciated.

  • 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-23T12:31:46+00:00Added an answer on May 23, 2026 at 12:31 pm

    Considering this: http://www.youtube.com/watch?v=hfx_M0p0KoM it seems that 2.1 does not support statement caching.

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

Sidebar

Related Questions

I'm using Netbeans... in the Glassfish server log I see INFO: Loading XML bean
using ejb 3.1, servlet 3.0 (glassfish server v3) Scenario: I have MDB that listen
have a weird situation. I'm using Glassfish server for my Enterprise application. In that
I develop using Glassfish bundle for Eclipse, that have the internal server to test
I am using Glassfish v3 server. Usually the DB connection with EJB3 + JPA
I am using Netbeans 7.1.1 and a Glassfish 3.1.2 server. As JPA provider I
I installed Ubuntu, GlassFish web server, installed JRuby on Rails using GlassFish's admin tools,
Using Sun Glassfish Enterprise server v2.1.1 I am using alternatedocroot via sun-web.xml for my
I recently migrated my JSF app(using primefaces) from glassfish 3.1 to tomcat7 server. Previously
I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything

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.