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

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!



      Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com

View raw message