Hi,
I refer to my earlier post :
http://forum.hibernate.org/viewtopic.php?t=927799&highlight=
Okay now i have managed to junit my hibernate app. I have created 2 connectionFactory-ies. 1 will return me a connection using the datasource and the other one will return me a JDBC direct conection. BUT I also realize in order to do this, I also need to specify 2 different hibernate.cfg.xml.
One xml is with the datasource name and the other one without the datasource. I did this because when hibernate load the hibernate.cfg.xml, it will try to resolve the datasource name *even though the app may not using it. This is how I end up with two hibernate.cfg.xml.
Something bothers me though. Is this the correct way of doing it ? Or can I specify whether i want to use a datasource or not programatically ?