mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-02 17:35:18 +00:00
unnecessary flushes seems about 20% snappier. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3296 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
44 lines
1006 B
Java
44 lines
1006 B
Java
/**
|
|
*
|
|
*/
|
|
package org.alfresco.repo.avm.hibernate;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
import org.alfresco.repo.avm.RetryingTransactionCallback;
|
|
import org.hibernate.HibernateException;
|
|
import org.hibernate.Session;
|
|
import org.springframework.orm.hibernate3.HibernateCallback;
|
|
|
|
/**
|
|
* This is a wrapper around HibernateTxnCallback implementation.
|
|
* @author britt
|
|
*/
|
|
public class HibernateCallbackWrapper implements HibernateCallback
|
|
{
|
|
/**
|
|
* The HibernateTxnCallback to execute.
|
|
*/
|
|
private RetryingTransactionCallback fCallback;
|
|
|
|
/**
|
|
* Make one up.
|
|
* @param callback
|
|
*/
|
|
public HibernateCallbackWrapper(RetryingTransactionCallback callback)
|
|
{
|
|
fCallback = callback;
|
|
}
|
|
|
|
/**
|
|
* Call the HibernateTxnCallback internally.
|
|
* @param session The Hibernate Session.
|
|
*/
|
|
public Object doInHibernate(Session session) throws HibernateException,
|
|
SQLException
|
|
{
|
|
fCallback.perform();
|
|
return null;
|
|
}
|
|
}
|