You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mike Van <mv...@comcast.net> on 2010/11/19 21:58:59 UTC

Accessing database connections using SpringDM in Karaf

Ok,  This is a doozy.

I'm using Karaf 2.0.0,  with SpringDM.  

My OSGi application has a database-access bundle which contains two
applicationContext.xml files in the META-INF/spring directory.  One of these
xml files creates a bean called myAppDataSourceController, which provides
access to our database via the associated pojo.  All this deploys properly
and I'm able to verify the database connection.

To test whether it works, I've created a simple Spring testHarness
consisting of one class (DAOTest.java) which attempts to use my
database-access bundle to connect to the database and write a column in a
table. It als has a testApplicationContext.xml file which creates a bean,
and references the method that begins the test in DAOTest.java.  This is
failing.

In my old non-osgi implementation, I had a DataSourceControllerFactory class
whose static final inner-class (named Holder) looks as such:

// non-important bits removed
private static final class Holder {

  private static final DataSourceController INSTANCE;

  static {
   final String[] contexts = {
    "META-INF/spring/ControllerAppContext.xml",
    "META-INF/spring/DataSourceAppContext.xml" };

   final ApplicationContext ctx = new
ClassPathXmlApplicationContext(contexts);
   INSTANCE = {DataSourceController}
ctx.getBean("myAppDataSourceController");

  }

}

I use this class to enforce the singleton pattern we are using.  The
enclosing class has one major method:
public static final DataSourceController getInstance() {
  try {
   return Holder.INSTANCE;
  } catch statement stuff...

}

When another part of the application tried to access the database, it would
call DataSourceControllerFactory.getInstance(), to get a copy of the
DataSourceController which would provide database access.

Is there a similar way to access a database from within Karaf?  Obviously,
this way isn't going to work as SpringDM evaluates the context.xml files,
and creates a connection before the above methods are called. In fact,
calling the above methods results in an attempt to read the context files
again, but from the module attempting to get a handle to the database
connection.

Anyhow, before this gets too long, I'm just looking for OSGi friendly
suggestions to access our database.  Can anyone help me out?

Mike Van
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1932916.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Accessing database connections using SpringDM in Karaf

Posted by Mike Van <mv...@comcast.net>.
Problem solved!

The issue was using "factory-method", which required the class I called to
be static.  This also required that all of my properties and thier mutators
be static.  This resulted in my bean that passed the reference not being
able to see my mutators.

The fix was to have my DAOTest class implement the InitializingBean,
changing the "doPopulate()" method to "afterPropertiesSet()", and then
removing all static declarations.

Thanks to Joed from the IRC group for helping me figure this out.

v/r,

Mike Van
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1993729.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Accessing database connections using SpringDM in Karaf

Posted by Mike Van <mv...@comcast.net>.
I think I'm almost there!  WOOT!!

Karaf is giving me the following error:
org.springframework.beans.NotWritablePropertyException: Invalid property
'controller' of bean class [java.lang.string]: Bean property 'controller' is
not writable or has an invalid setter method. Does the parameter type of the
setter match the return type of the getter?

Here is my pojo:

public class DAOTest {

 private static DataSourceController controller;

 public static void setController(DataSourceController controller){
  DAOTest.controller = controller;
 }

 public static DataSourceController getController() {
  return controller;
 }

 public static String dataPopulator() {
  // excercise the DAO and return "pass" if it passes
 }

}

Here is the DAOTestContext.xml file:

<bean id="DAOTest" class="myApp.testharness.DAOTest"
    factory-method="dataPopulator"
    p:controller-ref="dataSourceController"
/>

<osgi:reference id="DataSourceController"
     interface="myApp.controller.DataSourceControllerIfc" />

And here is the DataSourceContext.xml file from the myApp.controller bundle
which creates the service in Karaf:

<bean id="myAppDataSourceController"
class="myApp.controller.DataSourceController"
  p:Dao-ref="myAppDao" />

<osgi:service id="dataSourceController" ref="myAppDataSourceController"
  interface="myApp.controller.DataSourceControllerIfc"/>

In Karaf when I perform an ls on the myApp.controller bundle I get the
following:
Bundle <id> provides:
---------------------------
Bundle-SymboicName = myApp.controller
Bundle-Version = 0.0.1
objectClass = myApp.controller.DataSourceControllerIfc
org.springframework.osgi.bean.name = myAppDataSourceController
service.id = <number>

Does anyone have an idea what the issue is?  I also noticed that when I pass
a class reference via Spring to my pojo, it wont' let me pass in Strings or
Ints. Kind of unnerving.

v/r,

Mike Van
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1956889.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Accessing database connections using SpringDM in Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
Well with the karaf server and spring it's quite easy.

just make a single spring xml config file and deploy this.

The needed configuration could looks like this:

taken from the springsource documentation for a datasource

<bean id="dataSource"
         class="org.apache.commons.dbcp.BasicDataSource"  destroy-method="close">
     <property name="driverClassName"  value="${jdbc.driverClassName}"/>
     <property name="url"  value="${jdbc.url}"/>
     <property name="username"  value="${jdbc.username}"/>
     <property name="password"  value="${jdbc.password}"/>
</bean>



now you need also the commons dbcp and commons pool in your deploy 
directory.

for configuration you could go and use this

<context:property-placeholder location="jdbc.properties"/>

or better use the configuration admin service
more details on how to use this can be found in the very good 
documentation of spring-dm

now how to publish the bean as a service,

you just need to make sure you also have the spring-dm configure (but 
make sure it is 1.2 because this is the one supported by the karaf)

<service  ref="dataSource"  interface="java.sql.DataSource"/>

Now you have a service for your datasource.

Now with your other code just let the datasource be injected

<reference  id="myDataSourceReference"  interface="java.sql.DataSource"
   filter="(here might be a filter for example to select a certain DataSource Pool)"/>


Hope that helps you around, again take a good look at the documentation 
for spring-dm.
Blueprint is the same concerning the configuration above.

Cheers, Achim


Am 19.11.2010 22:45, schrieb Mike Van:
>
>
> Achim,
>
>
>
> That's very interesting. I'd be interested in seeing examples of what your'e talking about, if you can point me in the right direction.
>
>
>
> v/r,
>
>
>
> Mike Van
>
>
> ----- Original Message -----
> From: "Achim Nierbeck [via Karaf]"<ml...@n3.nabble.com>
> To: "Mike Van"<mv...@comcast.net>
> Sent: Friday, November 19, 2010 4:15:59 PM
> Subject: Re: Accessing database connections using SpringDM in Karaf
>
> Hi,
>
> if you don't want spring to start the application context, move your
> spring files to another directory.
> You might also take a look at the spring-dm documentation about what you
> can do to influence the starting behavior.
>
> BTW. do you know that you can let do spring take care of DataSources?
> You can even
> configure a datasource as a osgi-service and spring-dm or blueprint can
> take care of injecting this datasource service.
>
> greetings, achim
>
>
>> https://github.com/ANierbeck/jmx-webconsole
>> Ok,  This is a doozy.
>>
>> I'm using Karaf 2.0.0,  with SpringDM.
>>
>> My OSGi application has a database-access bundle which contains two
>> applicationContext.xml files in the META-INF/spring directory.  One of these
>> xml files creates a bean called myAppDataSourceController, which provides
>> access to our database via the associated pojo.  All this deploys properly
>> and I'm able to verify the database connection.
>>
>> To test whether it works, I've created a simple Spring testHarness
>> consisting of one class (DAOTest.java) which attempts to use my
>> database-access bundle to connect to the database and write a column in a
>> table. It als has a testApplicationContext.xml file which creates a bean,
>> and references the method that begins the test in DAOTest.java.  This is
>> failing.
>>
>> In my old non-osgi implementation, I had a DataSourceControllerFactory class
>> whose static final inner-class (named Holder) looks as such:
>>
>> // non-important bits removed
>> private static final class Holder {
>>
>>     private static final DataSourceController INSTANCE;
>>
>>     static {
>>      final String[] contexts = {
>>       "META-INF/spring/ControllerAppContext.xml",
>>       "META-INF/spring/DataSourceAppContext.xml" };
>>
>>      final ApplicationContext ctx = new
>> ClassPathXmlApplicationContext(contexts);
>>      INSTANCE = {DataSourceController}
>> ctx.getBean("myAppDataSourceController");
>>
>>     }
>>
>> }
>>
>> I use this class to enforce the singleton pattern we are using.  The
>> enclosing class has one major method:
>> public static final DataSourceController getInstance() {
>>     try {
>>      return Holder.INSTANCE;
>>     } catch statement stuff...
>>
>> }
>>
>> When another part of the application tried to access the database, it would
>> call DataSourceControllerFactory.getInstance(), to get a copy of the
>> DataSourceController which would provide database access.
>>
>> Is there a similar way to access a database from within Karaf?  Obviously,
>> this way isn't going to work as SpringDM evaluates the context.xml files,
>> and creates a connection before the above methods are called. In fact,
>> calling the above methods results in an attempt to read the context files
>> again, but from the module attempting to get a handle to the database
>> connection.
>>
>> Anyhow, before this gets too long, I'm just looking for OSGi friendly
>> suggestions to access our database.  Can anyone help me out?
>>
>> Mike Van
>
>
>
> View message @ http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1932992.html
> To start a new topic under Karaf - User, email ml-node+930749-917263437-228489@n3.nabble.com
> To unsubscribe from Karaf - User, click here .


Re: Accessing database connections using SpringDM in Karaf

Posted by Charles Moulliard <cm...@gmail.com>.
You can have a look to mytutorial --> 
http://camel.apache.org/tutorial-osgi-camel-part2.html

I will update it soon to use openJpa + Aries JPA + AriesTransaction 
instead of Spring + Hibernate

On 20/11/10 18:35, Johan Edstrom wrote:
> http://camel.apache.org/tutorials.html
>
> The second to last tutorial, Reportincident shows you all of these concepts.
>
>
> On Nov 19, 2010, at 2:45 PM, Mike Van wrote:
>
>>
>>
>> Achim,
>>
>>
>>
>> That's very interesting. I'd be interested in seeing examples of what your'e talking about, if you can point me in the right direction.
>>
>>
>>
>> v/r,
>>
>>
>>
>> Mike Van
>>
>>
>> ----- Original Message -----
>> From: "Achim Nierbeck [via Karaf]"<ml...@n3.nabble.com>
>> To: "Mike Van"<mv...@comcast.net>
>> Sent: Friday, November 19, 2010 4:15:59 PM
>> Subject: Re: Accessing database connections using SpringDM in Karaf
>>
>> Hi,
>>
>> if you don't want spring to start the application context, move your
>> spring files to another directory.
>> You might also take a look at the spring-dm documentation about what you
>> can do to influence the starting behavior.
>>
>> BTW. do you know that you can let do spring take care of DataSources?
>> You can even
>> configure a datasource as a osgi-service and spring-dm or blueprint can
>> take care of injecting this datasource service.
>>
>> greetings, achim
>>
>>
>>> https://github.com/ANierbeck/jmx-webconsole
>>> Ok,  This is a doozy.
>>>
>>> I'm using Karaf 2.0.0,  with SpringDM.
>>>
>>> My OSGi application has a database-access bundle which contains two
>>> applicationContext.xml files in the META-INF/spring directory.  One of these
>>> xml files creates a bean called myAppDataSourceController, which provides
>>> access to our database via the associated pojo.  All this deploys properly
>>> and I'm able to verify the database connection.
>>>
>>> To test whether it works, I've created a simple Spring testHarness
>>> consisting of one class (DAOTest.java) which attempts to use my
>>> database-access bundle to connect to the database and write a column in a
>>> table. It als has a testApplicationContext.xml file which creates a bean,
>>> and references the method that begins the test in DAOTest.java.  This is
>>> failing.
>>>
>>> In my old non-osgi implementation, I had a DataSourceControllerFactory class
>>> whose static final inner-class (named Holder) looks as such:
>>>
>>> // non-important bits removed
>>> private static final class Holder {
>>>
>>>     private static final DataSourceController INSTANCE;
>>>
>>>     static {
>>>      final String[] contexts = {
>>>       "META-INF/spring/ControllerAppContext.xml",
>>>       "META-INF/spring/DataSourceAppContext.xml" };
>>>
>>>      final ApplicationContext ctx = new
>>> ClassPathXmlApplicationContext(contexts);
>>>      INSTANCE = {DataSourceController}
>>> ctx.getBean("myAppDataSourceController");
>>>
>>>     }
>>>
>>> }
>>>
>>> I use this class to enforce the singleton pattern we are using.  The
>>> enclosing class has one major method:
>>> public static final DataSourceController getInstance() {
>>>     try {
>>>      return Holder.INSTANCE;
>>>     } catch statement stuff...
>>>
>>> }
>>>
>>> When another part of the application tried to access the database, it would
>>> call DataSourceControllerFactory.getInstance(), to get a copy of the
>>> DataSourceController which would provide database access.
>>>
>>> Is there a similar way to access a database from within Karaf?  Obviously,
>>> this way isn't going to work as SpringDM evaluates the context.xml files,
>>> and creates a connection before the above methods are called. In fact,
>>> calling the above methods results in an attempt to read the context files
>>> again, but from the module attempting to get a handle to the database
>>> connection.
>>>
>>> Anyhow, before this gets too long, I'm just looking for OSGi friendly
>>> suggestions to access our database.  Can anyone help me out?
>>>
>>> Mike Van
>>
>>
>>
>> View message @ http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1932992.html
>> To start a new topic under Karaf - User, email ml-node+930749-917263437-228489@n3.nabble.com
>> To unsubscribe from Karaf - User, click here .
>> -- 
>> View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1933143.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Accessing database connections using SpringDM in Karaf

Posted by Johan Edstrom <se...@gmail.com>.
http://camel.apache.org/tutorials.html

The second to last tutorial, Reportincident shows you all of these concepts.


On Nov 19, 2010, at 2:45 PM, Mike Van wrote:

> 
> 
> 
> Achim, 
> 
> 
> 
> That's very interesting. I'd be interested in seeing examples of what your'e talking about, if you can point me in the right direction. 
> 
> 
> 
> v/r, 
> 
> 
> 
> Mike Van 
> 
> 
> ----- Original Message ----- 
> From: "Achim Nierbeck [via Karaf]" <ml...@n3.nabble.com> 
> To: "Mike Van" <mv...@comcast.net> 
> Sent: Friday, November 19, 2010 4:15:59 PM 
> Subject: Re: Accessing database connections using SpringDM in Karaf 
> 
> Hi, 
> 
> if you don't want spring to start the application context, move your 
> spring files to another directory. 
> You might also take a look at the spring-dm documentation about what you 
> can do to influence the starting behavior. 
> 
> BTW. do you know that you can let do spring take care of DataSources? 
> You can even 
> configure a datasource as a osgi-service and spring-dm or blueprint can 
> take care of injecting this datasource service. 
> 
> greetings, achim 
> 
> 
>> https://github.com/ANierbeck/jmx-webconsole 
>> Ok,  This is a doozy. 
>> 
>> I'm using Karaf 2.0.0,  with SpringDM. 
>> 
>> My OSGi application has a database-access bundle which contains two 
>> applicationContext.xml files in the META-INF/spring directory.  One of these 
>> xml files creates a bean called myAppDataSourceController, which provides 
>> access to our database via the associated pojo.  All this deploys properly 
>> and I'm able to verify the database connection. 
>> 
>> To test whether it works, I've created a simple Spring testHarness 
>> consisting of one class (DAOTest.java) which attempts to use my 
>> database-access bundle to connect to the database and write a column in a 
>> table. It als has a testApplicationContext.xml file which creates a bean, 
>> and references the method that begins the test in DAOTest.java.  This is 
>> failing. 
>> 
>> In my old non-osgi implementation, I had a DataSourceControllerFactory class 
>> whose static final inner-class (named Holder) looks as such: 
>> 
>> // non-important bits removed 
>> private static final class Holder { 
>> 
>>    private static final DataSourceController INSTANCE; 
>> 
>>    static { 
>>     final String[] contexts = { 
>>      "META-INF/spring/ControllerAppContext.xml", 
>>      "META-INF/spring/DataSourceAppContext.xml" }; 
>> 
>>     final ApplicationContext ctx = new 
>> ClassPathXmlApplicationContext(contexts); 
>>     INSTANCE = {DataSourceController} 
>> ctx.getBean("myAppDataSourceController"); 
>> 
>>    } 
>> 
>> } 
>> 
>> I use this class to enforce the singleton pattern we are using.  The 
>> enclosing class has one major method: 
>> public static final DataSourceController getInstance() { 
>>    try { 
>>     return Holder.INSTANCE; 
>>    } catch statement stuff... 
>> 
>> } 
>> 
>> When another part of the application tried to access the database, it would 
>> call DataSourceControllerFactory.getInstance(), to get a copy of the 
>> DataSourceController which would provide database access. 
>> 
>> Is there a similar way to access a database from within Karaf?  Obviously, 
>> this way isn't going to work as SpringDM evaluates the context.xml files, 
>> and creates a connection before the above methods are called. In fact, 
>> calling the above methods results in an attempt to read the context files 
>> again, but from the module attempting to get a handle to the database 
>> connection. 
>> 
>> Anyhow, before this gets too long, I'm just looking for OSGi friendly 
>> suggestions to access our database.  Can anyone help me out? 
>> 
>> Mike Van 
> 
> 
> 
> 
> View message @ http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1932992.html 
> To start a new topic under Karaf - User, email ml-node+930749-917263437-228489@n3.nabble.com 
> To unsubscribe from Karaf - User, click here .
> -- 
> View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1933143.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Accessing database connections using SpringDM in Karaf

Posted by Mike Van <mv...@comcast.net>.


Achim, 



That's very interesting. I'd be interested in seeing examples of what your'e talking about, if you can point me in the right direction. 



v/r, 



Mike Van 


----- Original Message ----- 
From: "Achim Nierbeck [via Karaf]" <ml...@n3.nabble.com> 
To: "Mike Van" <mv...@comcast.net> 
Sent: Friday, November 19, 2010 4:15:59 PM 
Subject: Re: Accessing database connections using SpringDM in Karaf 

Hi, 

if you don't want spring to start the application context, move your 
spring files to another directory. 
You might also take a look at the spring-dm documentation about what you 
can do to influence the starting behavior. 

BTW. do you know that you can let do spring take care of DataSources? 
You can even 
configure a datasource as a osgi-service and spring-dm or blueprint can 
take care of injecting this datasource service. 

greetings, achim 


> https://github.com/ANierbeck/jmx-webconsole 
> Ok,  This is a doozy. 
> 
> I'm using Karaf 2.0.0,  with SpringDM. 
> 
> My OSGi application has a database-access bundle which contains two 
> applicationContext.xml files in the META-INF/spring directory.  One of these 
> xml files creates a bean called myAppDataSourceController, which provides 
> access to our database via the associated pojo.  All this deploys properly 
> and I'm able to verify the database connection. 
> 
> To test whether it works, I've created a simple Spring testHarness 
> consisting of one class (DAOTest.java) which attempts to use my 
> database-access bundle to connect to the database and write a column in a 
> table. It als has a testApplicationContext.xml file which creates a bean, 
> and references the method that begins the test in DAOTest.java.  This is 
> failing. 
> 
> In my old non-osgi implementation, I had a DataSourceControllerFactory class 
> whose static final inner-class (named Holder) looks as such: 
> 
> // non-important bits removed 
> private static final class Holder { 
> 
>    private static final DataSourceController INSTANCE; 
> 
>    static { 
>     final String[] contexts = { 
>      "META-INF/spring/ControllerAppContext.xml", 
>      "META-INF/spring/DataSourceAppContext.xml" }; 
> 
>     final ApplicationContext ctx = new 
> ClassPathXmlApplicationContext(contexts); 
>     INSTANCE = {DataSourceController} 
> ctx.getBean("myAppDataSourceController"); 
> 
>    } 
> 
> } 
> 
> I use this class to enforce the singleton pattern we are using.  The 
> enclosing class has one major method: 
> public static final DataSourceController getInstance() { 
>    try { 
>     return Holder.INSTANCE; 
>    } catch statement stuff... 
> 
> } 
> 
> When another part of the application tried to access the database, it would 
> call DataSourceControllerFactory.getInstance(), to get a copy of the 
> DataSourceController which would provide database access. 
> 
> Is there a similar way to access a database from within Karaf?  Obviously, 
> this way isn't going to work as SpringDM evaluates the context.xml files, 
> and creates a connection before the above methods are called. In fact, 
> calling the above methods results in an attempt to read the context files 
> again, but from the module attempting to get a handle to the database 
> connection. 
> 
> Anyhow, before this gets too long, I'm just looking for OSGi friendly 
> suggestions to access our database.  Can anyone help me out? 
> 
> Mike Van 




View message @ http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1932992.html 
To start a new topic under Karaf - User, email ml-node+930749-917263437-228489@n3.nabble.com 
To unsubscribe from Karaf - User, click here .
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Accessing-database-connections-using-SpringDM-in-Karaf-tp1932916p1933143.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Accessing database connections using SpringDM in Karaf

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

if you don't want spring to start the application context, move your 
spring files to another directory.
You might also take a look at the spring-dm documentation about what you 
can do to influence the starting behavior.

BTW. do you know that you can let do spring take care of DataSources? 
You can even
configure a datasource as a osgi-service and spring-dm or blueprint can 
take care of injecting this datasource service.

greetings, achim

> https://github.com/ANierbeck/jmx-webconsole
> Ok,  This is a doozy.
>
> I'm using Karaf 2.0.0,  with SpringDM.
>
> My OSGi application has a database-access bundle which contains two
> applicationContext.xml files in the META-INF/spring directory.  One of these
> xml files creates a bean called myAppDataSourceController, which provides
> access to our database via the associated pojo.  All this deploys properly
> and I'm able to verify the database connection.
>
> To test whether it works, I've created a simple Spring testHarness
> consisting of one class (DAOTest.java) which attempts to use my
> database-access bundle to connect to the database and write a column in a
> table. It als has a testApplicationContext.xml file which creates a bean,
> and references the method that begins the test in DAOTest.java.  This is
> failing.
>
> In my old non-osgi implementation, I had a DataSourceControllerFactory class
> whose static final inner-class (named Holder) looks as such:
>
> // non-important bits removed
> private static final class Holder {
>
>    private static final DataSourceController INSTANCE;
>
>    static {
>     final String[] contexts = {
>      "META-INF/spring/ControllerAppContext.xml",
>      "META-INF/spring/DataSourceAppContext.xml" };
>
>     final ApplicationContext ctx = new
> ClassPathXmlApplicationContext(contexts);
>     INSTANCE = {DataSourceController}
> ctx.getBean("myAppDataSourceController");
>
>    }
>
> }
>
> I use this class to enforce the singleton pattern we are using.  The
> enclosing class has one major method:
> public static final DataSourceController getInstance() {
>    try {
>     return Holder.INSTANCE;
>    } catch statement stuff...
>
> }
>
> When another part of the application tried to access the database, it would
> call DataSourceControllerFactory.getInstance(), to get a copy of the
> DataSourceController which would provide database access.
>
> Is there a similar way to access a database from within Karaf?  Obviously,
> this way isn't going to work as SpringDM evaluates the context.xml files,
> and creates a connection before the above methods are called. In fact,
> calling the above methods results in an attempt to read the context files
> again, but from the module attempting to get a handle to the database
> connection.
>
> Anyhow, before this gets too long, I'm just looking for OSGi friendly
> suggestions to access our database.  Can anyone help me out?
>
> Mike Van