You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by da...@apache.org on 2013/11/03 13:41:56 UTC

[1/3] git commit: Polished

Updated Branches:
  refs/heads/trunk 06356db1c -> 4ddbb8546


Polished


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

Branch: refs/heads/trunk
Commit: af1edf45888d559bf3b3e34e560b59c73fd16324
Parents: 06356db
Author: Claus Ibsen <cl...@gmail.com>
Authored: Sun Nov 3 11:52:44 2013 +0100
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Sun Nov 3 11:52:44 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/thread/Scheduler.java       | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/af1edf45/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java b/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java
index f746138..d6dc372 100755
--- a/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java
+++ b/activemq-client/src/main/java/org/apache/activemq/thread/Scheduler.java
@@ -44,7 +44,10 @@ public final class Scheduler extends ServiceSupport {
     /*
      * execute on rough schedule based on termination of last execution. There is no
      * compensation (two runs in quick succession) for delays
+     *
+     * @deprecated use {@link #executePeriodically}
      */
+    @Deprecated
     public synchronized void schedualPeriodically(final Runnable task, long period) {
         TimerTask timerTask = new SchedulerTimerTask(task);
         timer.schedule(timerTask, period, period);


[3/3] git commit: AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm in OSGi. As spring-dm may call getObject before postCostruct has been called.

Posted by da...@apache.org.
AMQ-2960: Fixed potential NPE in pooled connection factory in activemq-spring when using spring-dm in OSGi. As spring-dm may call getObject before postCostruct has been called.


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

Branch: refs/heads/trunk
Commit: 4ddbb8546d7ca50b57213da45f3fbd021ef7fe69
Parents: d0f48b3
Author: Claus Ibsen <cl...@gmail.com>
Authored: Sun Nov 3 13:40:38 2013 +0100
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Sun Nov 3 13:40:38 2013 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/pool/PooledConnectionFactoryBean.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/4ddbb854/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
----------------------------------------------------------------------
diff --git a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
index afd380f..6a9de11 100644
--- a/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
+++ b/activemq-spring/src/main/java/org/apache/activemq/pool/PooledConnectionFactoryBean.java
@@ -185,9 +185,12 @@ public class PooledConnectionFactoryBean implements FactoryBean {
         }
     }
 
-    // FactoryBean methods
     @Override
     public Object getObject() throws Exception {
+        // in case spring-dm calls getObject before this bean has been initialized
+        if (pooledConnectionFactory == null) {
+            afterPropertiesSet();
+        }
         return pooledConnectionFactory;
     }
 


[2/3] git commit: AMQ-1063: Fixed journaled JDBC checkpoint which would mark inTx eager, which was wrong, as getting the JDBC connection may fail. So the mark inTx should only happen if getting the connection was succesful.

Posted by da...@apache.org.
AMQ-1063: Fixed journaled JDBC checkpoint which would mark inTx eager, which was wrong, as getting the JDBC connection may fail. So the mark inTx should only happen if getting the connection was succesful.


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

Branch: refs/heads/trunk
Commit: d0f48b3ee504650330425707c363ea103be3c3dd
Parents: af1edf4
Author: Claus Ibsen <cl...@gmail.com>
Authored: Sun Nov 3 11:54:14 2013 +0100
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Sun Nov 3 11:54:14 2013 +0100

----------------------------------------------------------------------
 .../activemq/store/jdbc/TransactionContext.java       | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d0f48b3e/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
----------------------------------------------------------------------
diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
index c776306..66163b6 100755
--- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
+++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java
@@ -30,8 +30,6 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Helps keep track of the current transaction/JDBC connection.
- * 
- * 
  */
 public class TransactionContext {
 
@@ -40,7 +38,7 @@ public class TransactionContext {
     private final DataSource dataSource;
     private final JDBCPersistenceAdapter persistenceAdapter;
     private Connection connection;
-    private boolean inTx;
+    private volatile boolean inTx;
     private PreparedStatement addMessageStatement;
     private PreparedStatement removedMessageStatement;
     private PreparedStatement updateLastAckStatement;
@@ -68,12 +66,14 @@ public class TransactionContext {
                 IOException ioe = IOExceptionSupport.create(e);
                 persistenceAdapter.getBrokerService().handleIOException(ioe);
                 throw ioe;
-
             }
 
             try {
                 connection.setTransactionIsolation(transactionIsolation);
             } catch (Throwable e) {
+                // ignore
+                LOG.trace("Cannot set transaction isolation to " + transactionIsolation + " due " + e.getMessage()
+                        + ". This exception is ignored.", e);
             }
         }
         return connection;
@@ -147,7 +147,8 @@ public class TransactionContext {
                         connection.close();
                     }
                 } catch (Throwable e) {
-                    LOG.warn("Close failed: " + e.getMessage(), e);
+                    // ignore
+                    LOG.trace("Closing connection failed due: " + e.getMessage() + ". This exception is ignored.", e);
                 } finally {
                     connection = null;
                 }
@@ -159,8 +160,9 @@ public class TransactionContext {
         if (inTx) {
             throw new IOException("Already started.");
         }
-        inTx = true;
         connection = getConnection();
+        // only mark in tx if we could get a connection
+        inTx = true;
     }
 
     public void commit() throws IOException {