Merged V2.9 to HEAD

9848: Merged V2.2 to V2.9
      9610: Fixed ETWOTWO-548
   10232: Merged V2.2 to V2.9
      10231: Merged V2.1 to V2.2
         10229: Merged V2.1-A to V2.1
              10227: https://issues.alfresco.com/jira/browse/ADB-106
   10530: Merged V2.2 to V2.9
      9847: Applied patch for ETWOTWO-542 (supplied by Peter Monks)
      9897: Fix for ETWOTWO-302: Alphabetise advanced workflow names
      9901: Fixed ETWOTWO-426: V2.2 upgrade problems with MySQL 5.0.51
      9902: Fix for ETWOTWO-438: Versionable aspect and add-content permissions
      9905: Fix ETWOTWO-560
      9912: Increased test wait iterations from 10 (10s) to 100 (100s).
      9919: Part fix for ACT-3574: Added close for schema bootstrap connection


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10612 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-09-01 13:26:52 +00:00
parent 4c860ea167
commit 15fcd07997
13 changed files with 720 additions and 321 deletions

View File

@@ -28,6 +28,7 @@ import org.alfresco.service.transaction.TransactionService;
/**
* This is a helper class that knows how to issue identifiers.
*
* @author britt
*/
public class Issuer
@@ -81,41 +82,45 @@ public class Issuer
public void init()
{
fTxnService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Object>()
if (!fTxnService.isReadOnly())
{
public Object execute()
fTxnService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>()
{
IssuerID issuerID = fIDDAO.get(fName);
Long id = fIssuerDAO.getIssuerValue(fName);
if (issuerID == null || id == null || id >= issuerID.getNext())
public Object execute()
{
if (id == null)
IssuerID issuerID = fIDDAO.get(fName);
Long id = fIssuerDAO.getIssuerValue(fName);
if (issuerID == null || id == null || id >= issuerID.getNext())
{
id = 0L;
}
else
{
id = id + 1L;
}
if (issuerID == null)
{
issuerID = new IssuerIDImpl(fName, id);
fIDDAO.save(issuerID);
}
else
{
issuerID.setNext(id);
if (id == null)
{
id = 0L;
}
else
{
id = id + 1L;
}
if (issuerID == null)
{
issuerID = new IssuerIDImpl(fName, id);
fIDDAO.save(issuerID);
}
else
{
issuerID.setNext(id);
}
}
return null;
}
return null;
}
});
});
}
}
/**
* Set the name of this issuer. For Spring.
* @param name The name to set.
*
* @param name
* The name to set.
*/
public void setName(String name)
{
@@ -124,6 +129,7 @@ public class Issuer
/**
* Issue the next number.
*
* @return A serial number.
*/
public synchronized long issue()
@@ -153,13 +159,14 @@ public class Issuer
public long fLast;
/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see java.lang.Runnable#run()
*/
public void run()
{
fTxnService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Object>()
fTxnService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>()
{
public Object execute()
{