]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/NewStudyAction.java
Salome HOME
Refactoring continues: UserService is created instead of UserDirectory. Database...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / NewStudyAction.java
index 82755c5d540a0f444b075835030f7165750c337c..1a89f79a373e070b86bb9d533ba737dfad607887 100644 (file)
@@ -3,10 +3,6 @@ package org.splat.simer;
 import java.util.List;
 import java.util.ResourceBundle;
 
-import org.hibernate.HibernateException;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.Scenario;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.dal.bo.som.SimulationContextType;
@@ -57,13 +53,10 @@ public class NewStudyAction extends Action {
        }
 
        public String doCreate() throws Exception {
-               // -------------------------
                String[] input = context.split(",");
                int valid = Integer.valueOf(input[0]);
                String value = ""; // input[1] if exists
 
-               Session session = Database.getSession();
-               Transaction transax = session.beginTransaction();
                Study.Properties sprop = new Study.Properties();
 
                // Check arguments and creation of the study
@@ -84,7 +77,6 @@ public class NewStudyAction extends Action {
                                        .selectType("product");
                        contelm = getSimulationContextService()
                                        .selectSimulationContextsWhere(cprop.setType(product));
-                       transax.commit();
                        return INPUT; // Title empty, simply wait for input without error message
                }
                try {
@@ -112,18 +104,9 @@ public class NewStudyAction extends Action {
                        // Update of the session
                        number += 1;
                        open(study); // Opens the study,
-                       transax.commit();
                        return SUCCESS;
                } catch (Exception error) {
                        logger.error("Unable to save the study, reason:", error);
-                       if (transax != null && transax.isActive()) {
-                               // Second try-catch as the rollback could fail as well
-                               try {
-                                       transax.rollback();
-                               } catch (HibernateException backerror) {
-                                       logger.debug("Error rolling back transaction", backerror);
-                               }
-                       }
                        return ERROR;
                }
        }