public int getSectionsCount() {
try {
final int[] size = new int[1];
new HibernateTxFragment() {
protected void txFragment(Session session) throws Exception {
FlushMode oldFlushMode = session.getFlushMode();
session.setFlushMode(FlushMode.NEVER);
Query query = session.createQuery("from " + Section.class.getName() + " as section " +
"where section.workspace=:workspace");
query.setParameter("workspace", WorkspaceImpl.this);