<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Caching session in nuxeo while using automation client in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/caching-session-in-nuxeo-while-using-automation-client/m-p/315788#M2789</link>
    <description>&lt;P&gt;Nuxeo sessions cannot be serialized easily. But creating one should take no more than a few milliseconds, not seconds.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2012 15:45:12 GMT</pubDate>
    <dc:creator>Florent_Guillau</dc:creator>
    <dc:date>2012-08-21T15:45:12Z</dc:date>
    <item>
      <title>Caching session in nuxeo while using automation client</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/caching-session-in-nuxeo-while-using-automation-client/m-p/315787#M2788</link>
      <description>&lt;P&gt;Hi,
We are using automation client to access nuxeo from our java project. As session creation take a couple of seconds, we thought about creating session for the first time for each user and then caching it using couchbase chache tool for subsequent use. We had a problem doing this because nuxeo sessions are not serializable.  When trying to cache session we get the following Exception . How do we implement nuxeo session caching ? Thanks.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;java.lang.IllegalArgumentException: Non-serializable object
	at net.spy.memcached.transcoders.BaseSerializingTranscoder.serialize(BaseSerializingTranscoder.java:110)
	at net.spy.memcached.transcoders.SerializingTranscoder.encode(SerializingTranscoder.java:162)
	at net.spy.memcached.MemcachedClient.asyncStore(MemcachedClient.java:281)
	at net.spy.memcached.MemcachedClient.set(MemcachedClient.java:727)
	at com.tagcmd.api.core.dao.impl.CachingDao.cacheItem(CachingDao.java:37)
	at com.tagcmd.api.core.service.impl.CachingService.cacheItem(CachingService.java:22)
	at com.tagcmd.nuxeoapi.dao.impl.SessionDao.createSession(SessionDao.java:39)
	at com.tagcmd.nuxeoapi.service.impl.AssetServiceIntegrationTest.setup(AssetServiceIntegrationTest.java:49)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.io.NotSerializableException: org.nuxeo.ecm.automation.client.jaxrs.spi.DefaultSession
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
	at net.spy.memcached.transcoders.BaseSerializingTranscoder.serialize(BaseSerializingTranscoder.java:105)
	... 35 more
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Aug 2012 11:55:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/caching-session-in-nuxeo-while-using-automation-client/m-p/315787#M2788</guid>
      <dc:creator>nuxeonovice_</dc:creator>
      <dc:date>2012-08-16T11:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Caching session in nuxeo while using automation client</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/caching-session-in-nuxeo-while-using-automation-client/m-p/315788#M2789</link>
      <description>&lt;P&gt;Nuxeo sessions cannot be serialized easily. But creating one should take no more than a few milliseconds, not seconds.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2012 15:45:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/caching-session-in-nuxeo-while-using-automation-client/m-p/315788#M2789</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2012-08-21T15:45:12Z</dc:date>
    </item>
  </channel>
</rss>

