You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ma...@apache.org on 2007/03/30 09:21:02 UTC

svn commit: r523973 - /incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java

Author: manugeorge
Date: Fri Mar 30 00:21:01 2007
New Revision: 523973

URL: http://svn.apache.org/viewvc?view=rev&rev=523973
Log:
changing the MdbInvoker code to open and then close a connection each time it needs one in a try/finally block.

Modified:
    incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java

Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java?view=diff&rev=523973&r1=523972&r2=523973
==============================================================================
--- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java (original)
+++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java Fri Mar 30 00:21:01 2007
@@ -36,14 +36,11 @@
     private final Object target;
     private Connection connection;
     private Session session;
+    private ConnectionFactory connectionFactory;
 
     public MdbInvoker(ConnectionFactory connectionFactory, Object target) throws JMSException {
         this.target = target;
-        connection = connectionFactory.createConnection();
-        connection.start();
-
-        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
+        this.connectionFactory = connectionFactory;
         for (Method method : target.getClass().getMethods()) {
             String signature = MdbUtil.getSignature(method);
             signatures.put(signature, method);
@@ -57,7 +54,10 @@
         connection = null;
     }
 
-    private synchronized Session getSession() {
+    private synchronized Session getSession() throws JMSException{
+        connection = connectionFactory.createConnection();
+        connection.start();
+        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         return session;
     }
 
@@ -124,6 +124,7 @@
                 e.printStackTrace();
             } finally {
                 MdbUtil.close(producer);
+                destroy();
             }
         } catch (Throwable e) {
             e.printStackTrace();



Re: svn commit: r523973 - /incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java

Posted by Manu George <ma...@gmail.com>.
Sure just give me the location where all the other commiters have
added theirs and i will add my pic to the group :))

On 3/30/07, David Blevins <da...@visi.com> wrote:
> Whoo Hooo!!!  Manu's first commit!
>
> Alright, Manu, you probably didn't know this when you accepted
> commit, but it's a tradition to get your First Commit Revision Number
> (FCRN as we call them) ... tattooed on your arm.
>
> We expect to see pictures of "523973" in fresh ink by Monday!
>
> -David
>
> On Mar 30, 2007, at 12:21 AM, manugeorge@apache.org wrote:
>
> > Author: manugeorge
> > Date: Fri Mar 30 00:21:01 2007
> > New Revision: 523973
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=523973
> > Log:
> > changing the MdbInvoker code to open and then close a connection
> > each time it needs one in a try/finally block.
> >
> > Modified:
> >     incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/
> > src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java
> >
> > Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests-
> > beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java
> > URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/
> > itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/
> > mdb/MdbInvoker.java?view=diff&rev=523973&r1=523972&r2=523973
> > ======================================================================
> > ========
> > --- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/
> > src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java (original)
> > +++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/
> > src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java Fri Mar
> > 30 00:21:01 2007
> > @@ -36,14 +36,11 @@
> >      private final Object target;
> >      private Connection connection;
> >      private Session session;
> > +    private ConnectionFactory connectionFactory;
> >
> >      public MdbInvoker(ConnectionFactory connectionFactory, Object
> > target) throws JMSException {
> >          this.target = target;
> > -        connection = connectionFactory.createConnection();
> > -        connection.start();
> > -
> > -        session = connection.createSession(false,
> > Session.AUTO_ACKNOWLEDGE);
> > -
> > +        this.connectionFactory = connectionFactory;
> >          for (Method method : target.getClass().getMethods()) {
> >              String signature = MdbUtil.getSignature(method);
> >              signatures.put(signature, method);
> > @@ -57,7 +54,10 @@
> >          connection = null;
> >      }
> >
> > -    private synchronized Session getSession() {
> > +    private synchronized Session getSession() throws JMSException{
> > +        connection = connectionFactory.createConnection();
> > +        connection.start();
> > +        session = connection.createSession(false,
> > Session.AUTO_ACKNOWLEDGE);
> >          return session;
> >      }
> >
> > @@ -124,6 +124,7 @@
> >                  e.printStackTrace();
> >              } finally {
> >                  MdbUtil.close(producer);
> > +                destroy();
> >              }
> >          } catch (Throwable e) {
> >              e.printStackTrace();
> >
> >
>
>

Re: svn commit: r523973 - /incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 3/30/07, David Blevins <da...@visi.com> wrote:
> Whoo Hooo!!!  Manu's first commit!
>
> Alright, Manu, you probably didn't know this when you accepted
> commit, but it's a tradition to get your First Commit Revision Number
> (FCRN as we call them) ... tattooed on your arm.
>
> We expect to see pictures of "523973" in fresh ink by Monday!

Hehe, it definitely deserves its place on the website! ;-)

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: svn commit: r523973 - /incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java

Posted by David Blevins <da...@visi.com>.
Whoo Hooo!!!  Manu's first commit!

Alright, Manu, you probably didn't know this when you accepted  
commit, but it's a tradition to get your First Commit Revision Number  
(FCRN as we call them) ... tattooed on your arm.

We expect to see pictures of "523973" in fresh ink by Monday!

-David

On Mar 30, 2007, at 12:21 AM, manugeorge@apache.org wrote:

> Author: manugeorge
> Date: Fri Mar 30 00:21:01 2007
> New Revision: 523973
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=523973
> Log:
> changing the MdbInvoker code to open and then close a connection  
> each time it needs one in a try/finally block.
>
> Modified:
>     incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/ 
> src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java
>
> Modified: incubator/openejb/trunk/openejb3/itests/openejb-itests- 
> beans/src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java
> URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/ 
> itests/openejb-itests-beans/src/main/java/org/apache/openejb/test/ 
> mdb/MdbInvoker.java?view=diff&rev=523973&r1=523972&r2=523973
> ====================================================================== 
> ========
> --- incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/ 
> src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java (original)
> +++ incubator/openejb/trunk/openejb3/itests/openejb-itests-beans/ 
> src/main/java/org/apache/openejb/test/mdb/MdbInvoker.java Fri Mar  
> 30 00:21:01 2007
> @@ -36,14 +36,11 @@
>      private final Object target;
>      private Connection connection;
>      private Session session;
> +    private ConnectionFactory connectionFactory;
>
>      public MdbInvoker(ConnectionFactory connectionFactory, Object  
> target) throws JMSException {
>          this.target = target;
> -        connection = connectionFactory.createConnection();
> -        connection.start();
> -
> -        session = connection.createSession(false,  
> Session.AUTO_ACKNOWLEDGE);
> -
> +        this.connectionFactory = connectionFactory;
>          for (Method method : target.getClass().getMethods()) {
>              String signature = MdbUtil.getSignature(method);
>              signatures.put(signature, method);
> @@ -57,7 +54,10 @@
>          connection = null;
>      }
>
> -    private synchronized Session getSession() {
> +    private synchronized Session getSession() throws JMSException{
> +        connection = connectionFactory.createConnection();
> +        connection.start();
> +        session = connection.createSession(false,  
> Session.AUTO_ACKNOWLEDGE);
>          return session;
>      }
>
> @@ -124,6 +124,7 @@
>                  e.printStackTrace();
>              } finally {
>                  MdbUtil.close(producer);
> +                destroy();
>              }
>          } catch (Throwable e) {
>              e.printStackTrace();
>
>