ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mississippi John Hurt" <johnh...@gmail.com>
Subject Spring and Ibatis DAOs, Singleton vs Prototypes
Date Fri, 04 Aug 2006 17:27:32 GMT
Hi,
I'm wondering is it safe to have ibatis DAOs instantiated in spring
framework as singletons?  Say you have a DAO like below. How do most of you
who work with high-volume real-life apps instantiate DAOs like the below, as
singleton or prototype?

public class ObjectDaoIbatis  {
    public Object getObject(Long userId) {
        Object object = (Object)
getSqlMapClientTemplate().queryForObject("getObject", objectId);

        if (object == null) {
            logger.warn("error");
            throw new Exception(); }
        return object;
    }
}

Mime
View raw message