Statement Caching in GlassFish V3


In general, Statement Caching is a functionality of a jdbc driver. There do exist a few jdbc drivers that do not support caching of PreparedStatement, CallableStatement and Statement objects.

A new feature in GlassFish V3, Statement caching improves performance by searching for a match in the cache and returning the object instead of preparing the statement object every time. This is useful for applications that repeatedly execute the above type of statements. Pooling infrastructure in GlassFish V3 does what is depicted in the figure below.


Statement Cache Process


GlassFish V3 uses a Least Recently Used (LRU) strategy for evicting statement objects from the cache. Every time a new statement is parsed and created, there is an overhead and to overcome this, set statementcachesize attribute of jdbc connection pool to a non–zero value.

CLI


Create jdbc connection pool


Statement cache Size in CLI

GUI

Statement cache Size in GUI

Effects of statement caching on pool

When Statement caching is set to a non-negative value, and Flush connection pool is executed, connections in the statement cache are recreated.

Comments:

Do we have performance numbers for Statement caching ?

Posted by Raja on December 22, 2009 at 07:44 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

shalini_m

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today