https://bz.apache.org/bugzilla/show_bug.cgi?id=66513

--- Comment #2 from Vincent Liautaud <vincent.liaut...@free.fr> ---
Hi Christopher,
i confirm that this issue happens when using only one node.
In my opinion, the issue comes from the session object used to synchronize the
delete/insert sql request in DataSourceStore/JDBCStore. From what i can see the
session object is different for each request (the session attributes can be the
same but the objects themselves are different).

I made a test by replacing the "synchtonize(session)" by a "synchronize(lock)"
with a lock object define like this : "private static final Object lock = new
Object();"
=> It solves the issue (all "primary key constraint violation" disappear.
Of course this is not the good solution because it synchronize the code block
for each request, even for request using different sessionId (what could cause
performance problems). 

That is why i suggested to lock on a object that would lock all requests using
the same sessionId. 

Finaly regarding the race condition you mention at the end of your comment,
this is not something that should happen in our standard JEE application using
sessionIds stored in cookies (as all the servlet requests using a specific
sessionId should come from a unique client/browser "in sequence" - no AJAX
usage or equivalent => So we should not attend conditions where concurrent
requests updating the session attributes for a same sessionId be treated by
different nodes in //. The issue we face with those "primary key violation"
comes from an incomplete filter (where some requests on static components like
gif/css/... are not filtered correctly).

Do you agree with that ?

Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to