final DataSourceEntry[] entryResult = new DataSourceEntry[] {null};
try {
new HibernateTxFragment() {
protected void txFragment(Session session) throws Exception {
Query query = session.createQuery(" from " + DataSourceEntry.class.getName() + " entry where entry.name = :entryName ");
FlushMode oldFlushMode = session.getFlushMode();
session.setFlushMode(FlushMode.COMMIT);
query.setString("entryName", name);
query.setCacheable(true);
List results = query.list();
if (results.size() == 1) entryResult[0] = (DataSourceEntry) results.get(0);