MyBatis L2 cache & connection pool

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MyBatis L2 cache & connection pool

Jose María Zaragoza
Hi:

I'm using MyBatis 3.4.6 & MyBatis-Spring 1.3.1
I've got a question

If I've got a method like

@Transactional
private myMethod(){
    this.mapper.findData()  ;

}

where this.mapper instance is injected by Spring IOC and "findData"
query is cached locally (default MyBatis L2 cache )

When I invoke myMethod() **for second time** ( so, data should be cached )
is created a new SqlSession ?
is retrieved a new Connection from datasource pool ?
I don't know what is the exact instant when MyBatis knows that data are cached
I would like to avoid any Connection if my data are cached locally

Thanks and regards

--
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.