Regular |
|
Joined: Sat Apr 23, 2005 7:28 am Posts: 52
|
I'm just starting the refactor of an existing Swing App that presently uses a home rolled DAO with the intention of using Hibernate 3 as the data access and persistance layer.
I'm unsure about best practice for instantiating a SessionFactory - I know that it is advisable to have just one SessionFactory - but what is the accepted / best way to access from within the App.
I could create a singleton to wrap the SessionFactory and then make calls to ... singleton.getInstance().getSession() as needed.
Alternatively, I could bind a SessionFactory to a JNDI reference.
Advice?
db
|
|