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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:25:22+00:00 2026-06-12T17:25:22+00:00

I faced with very very low performance of Java EE (EJB + JSF) application

  • 0

I faced with very very low performance of Java EE (EJB + JSF) application and Hibernate(3.6.8.Final and 4.1.7.Final) on Glassfish 3.1.2. Sending about 300 select queries takes about 20 seconds. This is unacceptable.

I have exactly the same application deployed on JBoss and TomEE. There, the same 300 select queries takes about 1,5 second.

I found in google some answers that maybe hibernate.show_sql is true or hibernate.hbm2ddl make application soo slow. But it is not true. I turned off hibernate.show_sql but is doesn’t matter. Moreover, these options are true in the JBoss and TomEE versions and it works over 10 times faster!
I thought that this is the issue between Glasfish and Hibernate. But I have the next application with the same business logic, the same DAO with EntityManager provided by Hibernate but configurated with Spring. And the performance is great. It is weird, isn’t it?

persistence.xml from the defect version:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
  http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">

   <persistence-unit name="jee_project" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>jdbc/PostgreSQL</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
         <property name="hibernate.show_sql" value="false"/>
         <property name="current_session_context_class" value="thread"/>
      </properties>
   </persistence-unit>

</persistence>

Glassfish JDBC configuration

<jdbc-connection-pool driver-classname="" datasource-classname="org.postgresql.ds.PGConnectionPoolDataSource" res-type="javax.sql.ConnectionPoolDataSource" description="" name="PostgreSQLPool">
      <property name="User" value="postgresql"></property>
      <property name="DatabaseName" value="qazxsw"></property>
      <property name="LogLevel" value="0"></property>
      <property name="Password" value="1234"></property>
      <property name="ServerName" value="localhost"></property>
      <property name="Ssl" value="false"></property>
      <property name="ProtocolVersion" value="0"></property>
      <property name="TcpKeepAlive" value="false"></property>
      <property name="SocketTimeout" value="0"></property>
      <property name="PortNumber" value="5432"></property>
      <property name="LoginTimeout" value="0"></property>
      <property name="UnknownLength" value="2147483647"></property>
      <property name="PrepareThreshold" value="5"></property>
    </jdbc-connection-pool>
    <jdbc-resource pool-name="PostgreSQLPool" description="" jndi-name="jdbc/PostgreSQL__pm"></jdbc-resource>
    <jdbc-resource pool-name="PostgreSQLPool" description="" jndi-name="jdbc/PostgreSQL__nontx"></jdbc-resource>
  • 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-06-12T17:25:23+00:00Added an answer on June 12, 2026 at 5:25 pm

    I found the cause. The answer was hidden in the listings which I pasted above. Three months ago I deployed the same application on Glassfish. Then I used Glassfish first time. I found at some blog how to set datasource (at localhost:4848). Suppose my datasource was named jdbc/PostgreSQL. Then I get the exception that glassfish cannot find datasource jdbc/PostgreSQL__pm. Somewhere in Internet I found info that suffix __pm is needed. Next exception was about suffix __nontx. After changing the names, the application started. But also with very low performance.

    Now I added datasource named jdbc/PostgreSQL and it starts working with good performance!
    How it is possible that name of datasource was wrong, and in spite of all it was working (slowly)?

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

Sidebar

Related Questions

i just faced a very strange problem today. My Application Structure is: /app -
We were faced with very strange issue that made us crazy. Sometimes newly created
I faced a problem regarding loading ResourceBundle at server-side on Seam 2.2 application. In
Forgive me if this question is very vague Some time back i faced this
I work for a very small company. I was recently faced with the question
I have faced a very strange situation here. I am accessing database (MDB) through
I'm very new to C# and .NET and I find myself faced with a
I'm working at Windows Phone application these days and have faced the problem with
We faced a very strange issue (really strange for such mature product): how to
I'm still new to HTML5 but I faced a very strange behavior. (In Chrome)

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.