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:12:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e336ee02c -> 4fde93a2a


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/4fde93a2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4fde93a2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4fde93a2

Branch: refs/heads/trunk
Commit: 4fde93a2a1c908c82488f6ca555b37471dad2aac
Parents: e336ee0
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:12:00 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/4fde93a2/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