mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Changed copy on write to occur during lookup, rather than after lookup.
Much carnage, but it's way faster. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3172 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,6 +27,7 @@ import org.hibernate.SessionFactory;
|
||||
import org.hibernate.StaleStateException;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.exception.GenericJDBCException;
|
||||
import org.hibernate.exception.LockAcquisitionException;
|
||||
|
||||
/**
|
||||
* Helper for DAOs.
|
||||
@@ -106,26 +107,30 @@ public class HibernateTxn
|
||||
}
|
||||
// If we've lost a race or we've deadlocked, retry.
|
||||
if (t instanceof StaleStateException ||
|
||||
t instanceof GenericJDBCException)
|
||||
t instanceof GenericJDBCException ||
|
||||
t instanceof LockAcquisitionException)
|
||||
{
|
||||
if (t instanceof StaleStateException)
|
||||
{
|
||||
System.err.println("Lost Race");
|
||||
continue;
|
||||
}
|
||||
System.err.println("Deadlock");
|
||||
try
|
||||
else
|
||||
{
|
||||
long interval;
|
||||
synchronized (fRandom)
|
||||
System.err.println("Deadlock");
|
||||
try
|
||||
{
|
||||
interval = fRandom.nextInt(1000);
|
||||
long interval;
|
||||
synchronized (fRandom)
|
||||
{
|
||||
interval = fRandom.nextInt(1000);
|
||||
}
|
||||
Thread.sleep(interval);
|
||||
continue;
|
||||
}
|
||||
catch (InterruptedException ie)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
Thread.sleep(interval);
|
||||
}
|
||||
catch (InterruptedException ie)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user