Skip to content

Commit

Permalink
dotCMS#5931 no transaction while ddl mssql
Browse files Browse the repository at this point in the history
  • Loading branch information
dotjorgeu committed Jul 15, 2014
1 parent 2550e39 commit b991511
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.dotmarketing.startup.runonce;

import java.sql.Connection;
import java.sql.SQLException;

import com.dotmarketing.common.db.DotConnect;
import com.dotmarketing.db.DbConnectionFactory;
import com.dotmarketing.db.HibernateUtil;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.exception.DotRuntimeException;
import com.dotmarketing.startup.StartupTask;
Expand All @@ -15,11 +13,10 @@ public class Task01090AddWorkflowSchemeUniqueNameContraint implements StartupTas

final private String WORKFLOW_SCHEME_CONSTRAINT = "alter table workflow_scheme add constraint unique_workflow_scheme_name unique (name)";
public void executeUpgrade() throws DotDataException, DotRuntimeException {
Connection conn = null;
DotConnect dc = new DotConnect();
try {
conn = DbConnectionFactory.getConnection();
dc.executeStatement(WORKFLOW_SCHEME_CONSTRAINT, conn);
DbConnectionFactory.getConnection().setAutoCommit(true);
dc.executeStatement(WORKFLOW_SCHEME_CONSTRAINT);

} catch (SQLException e) {
Logger.error(this, e.getMessage()+". Create different schemes with the same name is not allowed. Please change the workflow scheme names duplicates.",e);
Expand Down

0 comments on commit b991511

Please # to comment.