ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Worke <jimwo...@yahoo.com>
Subject Proper usage of iBatis with EJB
Date Fri, 27 Jun 2008 02:20:50 GMT
Hi,

What is the proper way of using iBatis with EJB?  Currently, I have the following in my stateless
session bean ejbCreate():

            Reader reader = Resources.getResourceAsReader("dao.xml");
            this.daoManager = DaoManagerBuilder.buildDaoManager(reader);

Then any methods in the session bean that needs to get the DAO will need to do the following:

            ReportDAO reportDao = (ReportDAO) daoManager.getDao(ReportDAO.class);

Is the above method correct?  Or should a singleton be used to create the daoManager and to
retrieve the DAO?  I'm worried about thread-safety for singleton with EJB.

Thanks for your comment!



Regards,

Jim


      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com
http://mail.promotions.yahoo.com/newdomains/sg/


Mime
View raw message