Can I place AddDataSource in jetty-web.xml?

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

Can I place AddDataSource in jetty-web.xml?

Steve Sobol
I'm using JOTM:

   <Call name="addService">
     <Arg>
       <New class="org.mortbay.jetty.plus.JotmService">
         <Set name="Name">TransactionMgr</Set>
          <!-- set up a pooled DataSource -->
          <Call name="addDataSource">
              <Arg>jdbc/myDB</Arg>
              <!-- set up the datasource -->
              <Arg>
                <New class="org.enhydra.jdbc.standard.StandardXADataSource">
                  <Set name="DriverName">com.mysql.jdbc.Driver</Set>
                  <Set name="Url">jdbc:mysql:host/databaseSet>
                  <Set name="User">user</Set>
                  <Set name="Password">password</Set>
                </New>
              </Arg>
              <!-- set up a pool for the datasource -->
              <Arg>
                <New class="org.enhydra.jdbc.pool.StandardXAPoolDataSource">
                  <Arg type="Integer">4</Arg>
                  <Set name="MinSize">4</Set>
                  <Set name="MaxSize">15</Set>
                </New>
              </Arg>
         </Call>
       </New>
     </Arg>
   </Call>

I can take the call to AddDataSource out of jettyplus.xml and place it in
WEB-INF/jetty-web.xml and not lose any of the benefits of connection
pooling, right? Like most of my JDBC datasources, this one would only be
used in one particular web app.

Hm. Also, I can't have a jdbc/myDB in jettyplus and a jdbc/myDB in
WEB-INF/jetty-web.xml, correct? Could I have a jdbc/myDB in jetty-web for
one application, and a jdbc/myDB in jetty-web for another application? (not
that I'd do this, I'm just curious whether I can)

Thanks
   **SJS

--
JustThe.net - Steve Sobol / [hidden email] / PGP: 0xE3AE35ED
Coming to you from Southern California's High Desert, where the
temperatures are as high as the gas prices! / 888.480.4NET (4638)

"Life's like an hourglass glued to the table"   --Anna Nalick, "Breathe"


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Can I place AddDataSource in jetty-web.xml?

Steve Sobol
I previously wrote

> I'm using JOTM:

Which I've determined I shouldn't be. I only want connection pooling. I
don't need distributed transactions and that appears to be JOTM's raison d'etre.

So... New questions:

Can I place my data source definitions in jetty-web.xml but still use
connection pooling somehow? If so, how? Is there any point to using
connection pooling for a data source that will only be available to one webapp?

I'd be using MySQL Connector/J (com.mysql.jdbc.Driver). Connector/J does
have a ConnectionPoolDataSource implementation, so I believe I can do what I
want to do pretty easily. I'm just not sure exactly how to go about it. :)

--
JustThe.net - Steve Sobol / [hidden email] / PGP: 0xE3AE35ED
Coming to you from Southern California's High Desert, where the
temperatures are as high as the gas prices! / 888.480.4NET (4638)

"Life's like an hourglass glued to the table"   --Anna Nalick, "Breathe"


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support