Re: [mule-scm] [mule][25091] branches/mule-3.3.x/transports/jms/src/main/java/org/mule/ transport/jms/JmsMessageDispatcher.java: MULE-6557 - Fixing performance problem due to duplicate session creation when using cached session

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [mule-scm] [mule][25091] branches/mule-3.3.x/transports/jms/src/main/java/org/mule/ transport/jms/JmsMessageDispatcher.java: MULE-6557 - Fixing performance problem due to duplicate session creation when using cached session

Pablo Kraan
Can you add a test to ensure this does not happen again?

Pablo


On Wed, Dec 5, 2012 at 6:12 PM, <[hidden email]> wrote:
Revision
25091
Author
pablo.lagreca
Date
2012-12-05 15:12:43 -0600 (Wed, 05 Dec 2012)

Log Message

MULE-6557 - Fixing performance problem due to duplicate session creation when using cached session

Modified Paths

Diff

Modified: branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java (25090 => 25091)


--- branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java	2012-12-05 10:39:28 UTC (rev 25090)
+++ branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java	2012-12-05 21:12:43 UTC (rev 25091)
@@ -69,6 +69,7 @@
         {
             logger.warn("The returnOriginalMessageAsReply property will be ignored because disableTemporaryReplyToDestinations=false.  You need to disable temporary ReplyTo destinations in order for this propery to take effect.");
         }
+        logger.warn("Starting patched JmsMessageReceiver");
     }
 
     @Override
@@ -121,9 +122,9 @@
         boolean sessionManaged = true;
         try
         {
-            session = connector.getTransactionalResource(endpoint);
-            if (muleTx != null && muleTx.hasResource(session))
+            if (muleTx != null && muleTx.hasResource(connector.getConnection()))
             {
+                session = connector.getTransactionalResource(endpoint);
                 transacted = true;
             }
             // Should we be caching sessions? Note this is not part of the JMS spec.
@@ -138,7 +139,7 @@
                 }
                 else
                 {
-                    //session = connector.getSession(endpoint);
+                    session = connector.getTransactionalResource(endpoint);
                     cachedSession = session;
                 }
             }
@@ -147,7 +148,7 @@
                 // by now we're running with a different connector and connection
                 sessionManaged = muleTx != null && muleTx.isXA();
 
-                //session = connector.getSession(endpoint);
+                session = connector.getTransactionalResource(endpoint);
                 if (endpoint.getTransactionConfig().isTransacted())
                 {
                     transacted = true;

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: [mule-scm] [mule][25091] branches/mule-3.3.x/transports/jms/src/main/java/org/mule/ transport/jms/JmsMessageDispatcher.java: MULE-6557 - Fixing performance problem due to duplicate session creation when using cached session

Pablo La Greca
I tried to do a JUnit around the logic on how to acquire the jms Sessiion.

I end giving up because by the time I had my junit almost working the amount of refactoring that were required, in IMHO, were to much just for compared to the initial code changes required.

I will try to refactor JmsMessageDispatcher for 3.x code base, but don't won't to introduce so many changes in a bug fix release.


On Wed, Dec 5, 2012 at 6:35 PM, Pablo Kraan <[hidden email]> wrote:
Can you add a test to ensure this does not happen again?

Pablo


On Wed, Dec 5, 2012 at 6:12 PM, <[hidden email]> wrote:
Revision
25091
Author
pablo.lagreca
Date
2012-12-05 15:12:43 -0600 (Wed, 05 Dec 2012)

Log Message

MULE-6557 - Fixing performance problem due to duplicate session creation when using cached session

Modified Paths

Diff

Modified: branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java (25090 => 25091)


--- branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java	2012-12-05 10:39:28 UTC (rev 25090)
+++ branches/mule-3.3.x/transports/jms/src/main/java/org/mule/transport/jms/JmsMessageDispatcher.java	2012-12-05 21:12:43 UTC (rev 25091)
@@ -69,6 +69,7 @@
         {
             logger.warn("The returnOriginalMessageAsReply property will be ignored because disableTemporaryReplyToDestinations=false.  You need to disable temporary ReplyTo destinations in order for this propery to take effect.");
         }
+        logger.warn("Starting patched JmsMessageReceiver");
     }
 
     @Override
@@ -121,9 +122,9 @@
         boolean sessionManaged = true;
         try
         {
-            session = connector.getTransactionalResource(endpoint);
-            if (muleTx != null && muleTx.hasResource(session))
+            if (muleTx != null && muleTx.hasResource(connector.getConnection()))
             {
+                session = connector.getTransactionalResource(endpoint);
                 transacted = true;
             }
             // Should we be caching sessions? Note this is not part of the JMS spec.
@@ -138,7 +139,7 @@
                 }
                 else
                 {
-                    //session = connector.getSession(endpoint);
+                    session = connector.getTransactionalResource(endpoint);
                     cachedSession = session;
                 }
             }
@@ -147,7 +148,7 @@
                 // by now we're running with a different connector and connection
                 sessionManaged = muleTx != null && muleTx.isXA();
 
-                //session = connector.getSession(endpoint);
+                session = connector.getTransactionalResource(endpoint);
                 if (endpoint.getTransactionConfig().isTransacted())
                 {
                     transacted = true;

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email