Mybatis component L2 cache and OUT mode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Mybatis component L2 cache and OUT mode

Rahman Usta
Hello,

I try to activate L2 cache for mybatis component in an application. There are several stored procedure calls which have IN and OUT parameters. My goal is caching returned OUT parameters and serving this data on upcoming endpoint calls.

Mybatis rejects to cache callables that has OUT mode parameter.

Cause: org.apache.ibatis.executor.ExecutorException: Caching stored procedures with OUT params is not supported. Please configure useCache=false

I didn't understand why I should disable caching on this procedures :)

How way can I activate caching for this kind of mybatis calls?

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis component L2 cache and OUT mode

Erwan Letessier
Well,
I had a look to the implementation.
The private function throwing the exception is called "ensureNoOutParams" (class org.apache.ibatis.executor.CachingExecutor) , then the intention is very clear.
With classic select query, the results are fetched into a list that is written in the cache (or read from, the next times) and returned to the caller.
With OUT params, caller just provide targets variables, that are known only in the caller scope, 
then I don't know if there is a way for executor to access this information. so that OUT params can be  L2-cached.

cheers.



On Thursday, February 22, 2018 at 11:26:02 PM UTC+1, Rahman Usta wrote:
Hello,

I try to activate L2 cache for mybatis component in an application. There are several stored procedure calls which have IN and OUT parameters. My goal is caching returned OUT parameters and serving this data on upcoming endpoint calls.

Mybatis rejects to cache callables that has OUT mode parameter.

Cause: org.apache.ibatis.executor.ExecutorException: Caching stored procedures with OUT params is not supported. Please configure useCache=false

I didn't understand why I should disable caching on this procedures :)

How way can I activate caching for this kind of mybatis calls?

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.