Dialect
class name: ${db.script.dialect} */
private static final String PLACEHOLDER_SCRIPT_DIALECT = "\\$\\{db\\.script\\.dialect\\}";
+ private static final String MSG_BYPASSING_SCHEMA_UPDATE = "schema.update.msg.bypassing";
private static final String MSG_EXECUTING_SCRIPT = "schema.update.msg.executing_script";
private static final String MSG_OPTIONAL_STATEMENT_FAILED = "schema.update.msg.optional_statement_failed";
private static final String MSG_DUMPING_SCHEMA_CREATE = "schema.update.msg.dumping_schema_create";
@@ -650,12 +651,16 @@ public class SchemaBootstrap extends AbstractLifecycleBean
if (updateSchema)
{
updateSchema(cfg, session, connection);
+
+ // verify that all patches have been applied correctly
+ checkSchemaPatchScripts(cfg, session, connection, validateUpdateScriptPatches, false); // check scripts
+ checkSchemaPatchScripts(cfg, session, connection, preUpdateScriptPatches, false); // check scripts
+ checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, false); // check scripts
+ }
+ else
+ {
+ logger.info(I18NUtil.getMessage(MSG_BYPASSING_SCHEMA_UPDATE));
}
-
- // verify that all patches have been applied correctly
- checkSchemaPatchScripts(cfg, session, connection, validateUpdateScriptPatches, false); // check scripts
- checkSchemaPatchScripts(cfg, session, connection, preUpdateScriptPatches, false); // check scripts
- checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, false); // check scripts
// Reset the configuration
cfg.setProperty(Environment.CONNECTION_PROVIDER, defaultConnectionProviderFactoryClass);
diff --git a/source/java/org/alfresco/repo/node/db/NodeDaoService.java b/source/java/org/alfresco/repo/node/db/NodeDaoService.java
index 45ec879e45..34669b053d 100644
--- a/source/java/org/alfresco/repo/node/db/NodeDaoService.java
+++ b/source/java/org/alfresco/repo/node/db/NodeDaoService.java
@@ -277,6 +277,7 @@ public interface NodeDaoService
public Transaction getTxnById(long txnId);
public Transaction getLastTxn();
+ public Transaction getLastRemoteTxn();
public Transaction getLastTxnForStore(final StoreRef storeRef);
public int getTxnUpdateCount(final long txnId);
public int getTxnDeleteCount(final long txnId);
diff --git a/source/java/org/alfresco/repo/node/db/hibernate/HibernateNodeDaoServiceImpl.java b/source/java/org/alfresco/repo/node/db/hibernate/HibernateNodeDaoServiceImpl.java
index fb0989efb8..f0d9e052fe 100644
--- a/source/java/org/alfresco/repo/node/db/hibernate/HibernateNodeDaoServiceImpl.java
+++ b/source/java/org/alfresco/repo/node/db/hibernate/HibernateNodeDaoServiceImpl.java
@@ -1185,6 +1185,7 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
* Queries for transactions
*/
private static final String QUERY_GET_LAST_TXN_ID = "txn.GetLastTxnId";
+ private static final String QUERY_GET_LAST_REMOTE_TXN_ID = "txn.GetLastRemoteTxnId";
private static final String QUERY_GET_LAST_TXN_ID_FOR_STORE = "txn.GetLastTxnIdForStore";
private static final String QUERY_GET_TXN_UPDATE_COUNT_FOR_STORE = "txn.GetTxnUpdateCountForStore";
private static final String QUERY_GET_TXN_DELETE_COUNT_FOR_STORE = "txn.GetTxnDeleteCountForStore";
@@ -1222,6 +1223,30 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
return txn;
}
+ @SuppressWarnings("unchecked")
+ public Transaction getLastRemoteTxn()
+ {
+ HibernateCallback callback = new HibernateCallback()
+ {
+ public Object doInHibernate(Session session)
+ {
+ Query query = session.getNamedQuery(QUERY_GET_LAST_REMOTE_TXN_ID);
+ query.setString("serverIpAddress", ipAddress)
+ .setMaxResults(1)
+ .setReadOnly(true);
+ return query.uniqueResult();
+ }
+ };
+ Long txnId = (Long) getHibernateTemplate().execute(callback);
+ Transaction txn = null;
+ if (txnId != null)
+ {
+ txn = (Transaction) getSession().get(TransactionImpl.class, txnId);
+ }
+ // done
+ return txn;
+ }
+
@SuppressWarnings("unchecked")
public Transaction getLastTxnForStore(final StoreRef storeRef)
{
diff --git a/source/java/org/alfresco/repo/node/index/AbstractReindexComponent.java b/source/java/org/alfresco/repo/node/index/AbstractReindexComponent.java
index 732ddb9926..041a93e784 100644
--- a/source/java/org/alfresco/repo/node/index/AbstractReindexComponent.java
+++ b/source/java/org/alfresco/repo/node/index/AbstractReindexComponent.java
@@ -242,37 +242,19 @@ public abstract class AbstractReindexComponent implements IndexRecovery
}
}
}
-
- /**
- * Gets the last indexed transaction working back from the provided index.
- * This method can be used to hunt for a starting point for indexing of
- * transactions not yet in the index.
- */
- protected long getLastIndexedTxn(long lastTxnId)
+
+ protected enum InIndex
{
- // get the last transaction
- long lastFoundTxnId = lastTxnId + 10L;
- boolean found = false;
- while (!found && lastFoundTxnId >= 0)
- {
- // reduce the transaction ID
- lastFoundTxnId = lastFoundTxnId - 10L;
- // break out as soon as we find a transaction that is in the index
- found = isTxnIdPresentInIndex(lastFoundTxnId);
- if (found)
- {
- break;
- }
- }
- // done
- if (logger.isDebugEnabled())
- {
- logger.debug("Found last index txn before " + lastTxnId + ": " + lastFoundTxnId);
- }
- return lastFoundTxnId;
+ YES, NO, INDETERMINATE;
}
- protected boolean isTxnIdPresentInIndex(long txnId)
+ /**
+ * Determines if a given transaction is definitely in the index or not.
+ *
+ * @param txnId a specific transaction
+ * @return Returns true if the transaction is definitely in the index
+ */
+ protected InIndex isTxnIdPresentInIndex(long txnId)
{
if (logger.isDebugEnabled())
{
@@ -282,7 +264,7 @@ public abstract class AbstractReindexComponent implements IndexRecovery
Transaction txn = nodeDaoService.getTxnById(txnId);
if (txn == null)
{
- return true;
+ return InIndex.YES;
}
// count the changes in the transaction
@@ -290,28 +272,38 @@ public abstract class AbstractReindexComponent implements IndexRecovery
int deleteCount = nodeDaoService.getTxnDeleteCount(txnId);
if (logger.isDebugEnabled())
{
- logger.debug("Transaction has " + updateCount + " updates and " + deleteCount + " deletes: " + txnId);
+ logger.debug("Transaction " + txnId + " has " + updateCount + " updates and " + deleteCount + " deletes.");
}
- // get the stores
- boolean found = false;
- ListUsed to provide passthru authentication to a remote Windows server using multiple stages that * allows authentication details to be passed between a client and the remote authenticating server without @@ -59,6 +61,28 @@ public class NTLMPassthruToken extends NTLMLocalToken super("", ""); } + /** + * Class constructor + * + * @params domain String + */ + public NTLMPassthruToken( String domain) + { + // We do not know the username yet, and will not know the password + + super("", "", domain, null); + } + + /** + * Class constructor + * + * @param ipAddr InetAddress + */ + public NTLMPassthruToken( InetAddress ipAddr) + { + super( ipAddr); + } + /** * Return the challenge *