Re: InSessionPageStore not storing page in http session

2022-04-26 Thread Wayne W
Ah,

please ignore. I was overriding the wrong method. It should be:

setPageManagerProvider(new DefaultPageManagerProvider(this) {
protected IPageStore newCachingStore(IPageStore pageStore)
{
return new CachingPageStore(pageStore, new InSessionPageStore( 2,
serializer));
}
});


This now seems to be working locally fine now.


On Tue, Apr 26, 2022 at 12:25 PM Wayne W 
wrote:

> Hello,
>
> Since migrating to 9.4 we have found that our app no longer supports
> session failover correctly. We use Redission tomcat to store the tomcat
> session in Redis. This works fine.
>
> However after a lot of debugging I can see that InSessionPageStore does
> not serialize the page into the http session, and that for the next request
> the page is always retrieved from the disk store.
>
> The reason it seems is that by default the serializer is null in
> InSessionPageStore and in the SessionData::writeObject if this is null then
> the page is not serialized and stored.
>
> So did this in the application:
>
> ISerializer serializer = new JavaSerializer(getApplicationKey());
> getFrameworkSettings().setSerializer(serializer);
> getStoreSettings().setAsynchronous(false);
> setPageManagerProvider(new DefaultPageManagerProvider(this) {
> @Override
> protected IPageStore newPersistentStore() {
> return new InSessionPageStore( 2, serializer);
> }
> });
>
> However now I have lots of strange behaviour where the page is not found
> at all. This seems to stem from the fact that SessionData::get returns in
> instance of SerializedPage now. However in
> DefaultMapperContext::getPageInstance its expecting an instance of
> IRequestablePage which SerializedPage is not. Therefore the page is never
> found.
>
> How do I setup InSessionPageStore to actually serialize the page into the
> http session? as by default the page variable is always null on the next
> request?
>
> Many thanks
>


InSessionPageStore not storing page in http session

2022-04-26 Thread Wayne W
Hello,

Since migrating to 9.4 we have found that our app no longer supports
session failover correctly. We use Redission tomcat to store the tomcat
session in Redis. This works fine.

However after a lot of debugging I can see that InSessionPageStore does not
serialize the page into the http session, and that for the next request the
page is always retrieved from the disk store.

The reason it seems is that by default the serializer is null in
InSessionPageStore and in the SessionData::writeObject if this is null then
the page is not serialized and stored.

So did this in the application:

ISerializer serializer = new JavaSerializer(getApplicationKey());
getFrameworkSettings().setSerializer(serializer);
getStoreSettings().setAsynchronous(false);
setPageManagerProvider(new DefaultPageManagerProvider(this) {
@Override
protected IPageStore newPersistentStore() {
return new InSessionPageStore( 2, serializer);
}
});

However now I have lots of strange behaviour where the page is not found at
all. This seems to stem from the fact that SessionData::get returns in
instance of SerializedPage now. However in
DefaultMapperContext::getPageInstance its expecting an instance of
IRequestablePage which SerializedPage is not. Therefore the page is never
found.

How do I setup InSessionPageStore to actually serialize the page into the
http session? as by default the page variable is always null on the next
request?

Many thanks