Why does MyBatis-Spring use SqlSessionFactoryBean?

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

Why does MyBatis-Spring use SqlSessionFactoryBean?

yue yan
Hi, I don't understand the reason why use factory parttern to product a SqlSessionFactory. The SqlSessionFactoryBean is a singleton in fact.  why not use a bean intead of a factory bean. thanks 

--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/77d162ea-9e2e-4928-bc7f-a694a5ae65abn%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Why does MyBatis-Spring use SqlSessionFactoryBean?

Biao Huang
SqlSessionFactoryBean is used to create SqlSession object by invoking its method getObject().

yue yan <[hidden email]> 于2020年9月21日周一 上午10:28写道:
Hi, I don't understand the reason why use factory parttern to product a SqlSessionFactory. The SqlSessionFactoryBean is a singleton in fact.  why not use a bean intead of a factory bean. thanks 

--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/77d162ea-9e2e-4928-bc7f-a694a5ae65abn%40googlegroups.com.


--
=====================================
QQ:     26664141
Skype: biao.mac
EMail:  [hidden email]

Tel: Home:  495312217000
Tel: Mobile: 4917620793369

--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CAAPc23MgGd5Ev3VpDshHYyFH6f0m%2BDQZnvyM%3DUmg%3DmkOeYKHwQ%40mail.gmail.com.