ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject ambari git commit: AMBARI-15246. Set MySQL transaction isolation level to READ_COMMITTED. (mpapirkovskyy)
Date Thu, 03 Mar 2016 17:11:36 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 63dd0db06 -> b3c3d66a5


AMBARI-15246. Set MySQL transaction isolation level to READ_COMMITTED. (mpapirkovskyy)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b3c3d66a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b3c3d66a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b3c3d66a

Branch: refs/heads/branch-2.2
Commit: b3c3d66a5332e84bd4efd464b9515cf116b9d114
Parents: 63dd0db
Author: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Authored: Tue Mar 1 17:51:56 2016 +0200
Committer: Myroslav Papirkovskyi <mpapyrkovskyy@hortonworks.com>
Committed: Thu Mar 3 19:11:32 2016 +0200

----------------------------------------------------------------------
 .../ambari/server/orm/EclipseLinkSessionCustomizer.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b3c3d66a/ambari-server/src/main/java/org/apache/ambari/server/orm/EclipseLinkSessionCustomizer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/EclipseLinkSessionCustomizer.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/EclipseLinkSessionCustomizer.java
index 2f4aacb..bb2ca7a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/EclipseLinkSessionCustomizer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/EclipseLinkSessionCustomizer.java
@@ -20,6 +20,8 @@ package org.apache.ambari.server.orm;
 import javax.activation.DataSource;
 
 import org.eclipse.persistence.config.SessionCustomizer;
+import org.eclipse.persistence.platform.database.MySQLPlatform;
+import org.eclipse.persistence.sessions.DatabaseLogin;
 import org.eclipse.persistence.sessions.JNDIConnector;
 import org.eclipse.persistence.sessions.Session;
 
@@ -49,10 +51,14 @@ public class EclipseLinkSessionCustomizer implements SessionCustomizer
{
   /**
    * {@inheritDoc}
    * <p/>
-   * Currently a NOOP, this class exists for quick customization purposes.
+   * This class exists for quick customization purposes.
    */
   @Override
   public void customize(Session session) throws Exception {
-    // NOOP
+    //Override transaction isolation level for MySQL to match EclipseLink shared cache behavior
+    DatabaseLogin databaseLogin = (DatabaseLogin) session.getDatasourceLogin();
+    if (databaseLogin.getDatasourcePlatform() instanceof MySQLPlatform) {
+      databaseLogin.setTransactionIsolation(DatabaseLogin.TRANSACTION_READ_COMMITTED);
+    }
   }
 }


Mime
View raw message