users@glassfish.java.net

Re: ClusterJSP

From: <glassfish_at_javadesktop.org>
Date: Thu, 20 Nov 2008 01:16:08 PST

i'm still working on this issue and now i have some detailed information.

i thought about debugging sql queries on hadb but not know actually if it is possible.
So i tried another way to see the queries:

First, i installed mysql and switch on the log parameter. Then i created a mysql pool and jdbc resource on glassfish.
Then i changed the jdbc resource parameters of availability options.. now my system is using mysql as ha db.
And now i can see the queries that are run by glassfish.

After my first attempt to run the clusterJSP application, i saw the configuration of tables that are required by glassfish ha system(from column names in the query). Then i created sessionheader and sessionattribute tables.

Before the tables are not created, the session Id isn’t persisted. After the tables are created, now i can see that the system is using the same sessionId.
mysql> select * from sessionheader;
+------------------------------+-------+-------------+---------------+---------------------------------------------+----------+-------+
| id | valid | maxinactive | lastaccess | appid | username | ssoid |
+------------------------------+-------+-------------+---------------+---------------------------------------------+----------+-------+
| a462eeb195a679f58d7119262f9a | 1 | 1800 | 1227191664999 | cluster1:com.sun.appserv:server:/clusterjsp | | |
+------------------------------+-------+-------------+---------------+---------------------------------------------+----------+-------+


And when i add a session attribute to my session i saw that there is an insert operation to the sessionattribute table.
                     37 Query INSERT INTO sessionattribute (rowid, sessattrdata, id, attributename, appid) VALUES ('a462eeb195a679f58d7119262f9a:22', _
binary'<AC><ED>\0^Et\0^B22', 'a462eeb195a679f58d7119262f9a', '22', 'cluster1:com.sun.appserv:server:/clusterjsp')


here is my table:

mysql> select rowid, id, attributename, appid from sessionattribute;
+----------------------------------------------------------+------------------------------+-----------------------------+---------------------------------------------+
| rowid | id | attributename | appid |
+----------------------------------------------------------+------------------------------+-----------------------------+---------------------------------------------+
| a462eeb195a679f58d7119262f9a:javax.security.auth.subject | a462eeb195a679f58d7119262f9a | javax.security.auth.subject | cluster1:com.sun.appserv:server:/clusterjsp |
| a462eeb195a679f58d7119262f9a:ttt | a462eeb195a679f58d7119262f9a | ttt | cluster1:com.sun.appserv:server:/clusterjsp |
| a462eeb195a679f58d7119262f9a:javax.security.auth.subject | a462eeb195a679f58d7119262f9a | javax.security.auth.subject | cluster1:com.sun.appserv:server:/clusterjsp |
| a462eeb195a679f58d7119262f9a:sdf | a462eeb195a679f58d7119262f9a | sdf | cluster1:com.sun.appserv:server:/clusterjsp |
| a462eeb195a679f58d7119262f9a:11 | a462eeb195a679f58d7119262f9a | 11 | cluster1:com.sun.appserv:server:/clusterjsp |
| a462eeb195a679f58d7119262f9a:22 | a462eeb195a679f58d7119262f9a | 22 | cluster1:com.sun.appserv:server:/clusterjsp |
+----------------------------------------------------------+------------------------------+-----------------------------+---------------------------------------------+
6 rows in set (0.00 sec)


So the most important point: when i click to the “reload page” button, i expect that there will be a select query to the database to get the attributes of that session, but there is not.
The only query that i saw is an update query after reload operation:

38 Query UPDATE sessionheader SET valid = '1', maxinactive = 1800, lastaccess = 1227191264492, username = '', ssoid = '' WHERE id
= 'a462eeb195a679f58d7119262f9a' AND appid = 'cluster1:com.sun.appserv:server:/clusterjsp'

So, i think this is a very detailed information for our case. Am i wrong to expect a select query on sessionattribute table? Are the attributes coming from browser session?
[Message sent by forum member 'yavuzs' (yavuzs)]

http://forums.java.net/jive/thread.jspa?messageID=317794