}
public static Object runWork(final HibernateWork work) throws Throwable {
final Throwable[] error = new Throwable[] {null};
final Object[] result = new Object[] {null};
Factory.doWork(new FactoryWork() {
public void doWork() {
try {
new HibernateTxFragment() {
protected void txFragment(Session session) throws Throwable {
result[0] = work.doWork(session);