Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance with JSF + Glassfish + PostgreSQL

 
Andris Sigs
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On one computer I have Glassfish server and PostreSQL DB.

So I use JavaServer Faces. When my facelet page is without any connection to db, then page loads very fast.

But when I use db connection (very simple, for example, select all rows from tabele with 5 rows), page loads 3-5 seconds.

Where can be problem? Why working with db is so slow?

Directly in postrgers(pgAdmin) query executes on ~10ms.

My persistence.xml:



GenericDaoImpl:



For example, in MenusDao I have this function:



When I load page which loads this function, then page loads on 3-4 seconds.
Thanks!
 
Tim Holloway
Bartender
Posts: 18419
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard for me to say. You didn't include your View Template, so I don't know if you are invoking the database mechanisms in an efficient manner and I don't know if you are attempting to define your backing bean in Request Scope (which almost never works).

JSF is not something I consider to be a lightweight technology. Its main strengths are in making it easier to design and implement apps whose primary interaction is via forms. So, depending on what the rest of your code looks like, how well-tuned your systems and networks are, and a number of other factors, a 3-4 second response time might be normal.

If you were getting a 30-40 second response time, that would be something to get concerned about.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!