public WorkspaceImpl[] getWorkspaces() {
final List<WorkspaceImpl> workspaces = new ArrayList<WorkspaceImpl>();
HibernateTxFragment txFragment = new HibernateTxFragment() {
protected void txFragment(Session session) throws Exception {
FlushMode oldFlushMode = session.getFlushMode();
session.setFlushMode(FlushMode.NEVER);
Query q = session.createQuery(" from " + WorkspaceImpl.class.getName());
q.setCacheable(true);
workspaces.addAll(q.list());
session.setFlushMode(oldFlushMode);