java - Updating Apache Ignite WebSession attributes -


we integrating apache ignite in our application share sessions in cluster. see ignite docs. @ point can share sessions between 2 local tomcat instances, there's 1 use case, (seems) not supported ignite.

in our application, have session object called 'profile'. profile user specific , kinds of attributes added object while user browses through application.

we update 'profile' object in following way (pseudo code):

profile = request.getsession().getprofile(); //get profile object session profile.setlastvisitedpage("test"); 

without apache ignite, our session contain correct value 'setlastvisitedpage' ('test'). when using ignite, ignite 'websession' object seems work bit different: when setting 'setlastvisitedpage' value in session object, websession first correctly contain correct value ('test'), when browsing next page, websession object, resolved ignite cache doesn't contain changed 'setlastvisitedpage' attribute.

i've taken @ ignite code , think, know why not working expected. looking @ ignite 'websession' class, see following method:

public void setattribute(string name, object val) {     attrs.put(name, val);      if (updates != null)         updates.add(new t2<>(name, val)); } 

in short: ignite expects after every update session object, call session.setattribute method, ignite add change it's internal 'updates' collection, used update object in ignite grid. solution our application change our applications code, call setattribute after every update, use code dependencies, can't change , may not call setattribute after session object change..

is there reason why ignite requires call setattribute after session object change, or flaw in ignite?

you're right, that's how implemented right , workaround explicitly call setattribute() on each update. think can improved , created apache ignite ticket: https://issues.apache.org/jira/browse/ignite-2594


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -