You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mark Ashworth <mp...@gmail.com> on 2012/08/30 08:38:09 UTC
Best database access strategy to use in OSGi environment
Good day,
I come from a JEE environment that is primarily dominated by EJB, JPA and
JSF and I have found that many of these heavy weight approaches do not work
so well. For example, I tried JSF but found that the Apache Wicket library
together with Pax-Wicket was a far better approach.
I am now trying to determine the best database access strategy to use so if
there are any suggestions that would most appreciated.
Regards,
Mark P Ashworth
http://mpashworth.wordpress.com
--
View this message in context: http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Best database access strategy to use in OSGi environment
Posted by Mark Ashworth <mp...@gmail.com>.
Hi Charles,
Url
http://www.infoq.com/presentations/Scala-Guardian
Summary
Graham Tackley shares the lessons learned running The Guardian website on
Java, and why they decided to switch to Scala and how it helps them.
Bio
Graham Tackley is the Web Platform Team Lead for guardian.co.uk and a
Pragmatic Scala Adopter. He and his team make sure the website can scale and
evolve the platform to enable reader engagement in new and innovative ways.
Recently, most of his time has been occupied with the Open Platform Content
API which provides access to all of the Guardian's current and historical
web content.
About the conference
Software is changing the world; QCon aims to empower software development by
facilitating the spread of knowledge and innovation in the enterprise
software development community; to achieve this, QCon is organized as a
practitioner-driven conference designed for people influencing innovation in
their teams: team leads, architects, project managers, engineering
directors.
Regards,
Mark P Ashworth
--
View this message in context: http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883p4025893.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Best database access strategy to use in OSGi environment
Posted by Charles Moulliard <ch...@gmail.com>.
Hi Mark,
Can you share the infoqQ link please ?
Regards,
Charles
On Thu, Aug 30, 2012 at 12:12 PM, Mark Ashworth <mp...@gmail.com>wrote:
> Good day Brian & Charles,
>
> Thank you very much for the information and the sample feature.xml files,
> it
> is really going to help a lot.
>
> Many of the media articles and web posts mention that OSGi can be HAZARDOUS
> do a developers health but on the whole (except getting Hazelcast to work
> but that was my misconception of OSGi) the development / build / deploy
> process seems more fluid and streamlined to the more traditional JEE
> methodlogy. During the day I develop for Oracle Weblogic and the number of
> frameworks and libraries that do not work on this platform is astounding
> and
> therefore when I watched the InfoQ presentation on guardian.co.uk and how
> they adopted values in choosing the coding platform to use, I decided that
> I
> should do the same. And although I am not using Scala, as is the case for
> guardian.co.uk, I have found OSGi and primarily Karaf being the solution
> to
> the values that I hold dear as a developer / designer / integrator.
>
> Regards,
> Mark P Ashworth
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883p4025887.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com
Re: Best database access strategy to use in OSGi environment
Posted by Mark Ashworth <mp...@gmail.com>.
Good day Brian & Charles,
Thank you very much for the information and the sample feature.xml files, it
is really going to help a lot.
Many of the media articles and web posts mention that OSGi can be HAZARDOUS
do a developers health but on the whole (except getting Hazelcast to work
but that was my misconception of OSGi) the development / build / deploy
process seems more fluid and streamlined to the more traditional JEE
methodlogy. During the day I develop for Oracle Weblogic and the number of
frameworks and libraries that do not work on this platform is astounding and
therefore when I watched the InfoQ presentation on guardian.co.uk and how
they adopted values in choosing the coding platform to use, I decided that I
should do the same. And although I am not using Scala, as is the case for
guardian.co.uk, I have found OSGi and primarily Karaf being the solution to
the values that I hold dear as a developer / designer / integrator.
Regards,
Mark P Ashworth
--
View this message in context: http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883p4025887.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Best database access strategy to use in OSGi environment
Posted by Charles Moulliard <ch...@gmail.com>.
As Brian mentions, Apache Aries JPA project is the way to go on Apache
Karaf to use ORM with OpenJPA or any other ORM tool Hibernate, EclipseLink,
...
More info is available here :
http://aries.apache.org/modules/jpaproject.html
http://www.slideshare.net/skillsmatter/apache-aries-blog-sample
Regards,
On Thu, Aug 30, 2012 at 9:13 AM, Brian Topping <to...@codehaus.org> wrote:
> Mark,
>
> I did a lot of research on this and found that OpenJPA with Apache Aries
> is the best way to go. Aries supports a few different JPA providers (not
> Hibernate for various technical reasons), OpenJPA seemed to be the best of
> them.
>
> Then, by making the datasource it's own bundle, I set configuration in the
> feature so that just by changing the feature, the database is reconfigured
> between providers such as PostgreSQL or MySQL. This allows specific users
> to select which database they want to use and have it configured properly
> just by selecting the proper feature to compliment OpenJPA with. For
> instance:
>
> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"
> name="datasource">
> >
> <repository>mvn:org.apache.karaf.features/enterprise/3.0.0-SNAPSHOT/xml/features</repository>
> > <feature description="Datasource" version="1.0.0-SNAPSHOT"
> name="datasource">
> > <feature>jndi</feature>
> > <feature>transaction</feature>
> > <bundle>wrap:mvn:com.experlog/xapool/1.5.0</bundle>
> >
> <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
> >
> <bundle>mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0</bundle>
> > <bundle>wrap:mvn:aopalliance/aopalliance/1.0</bundle>
> > <bundle>wrap:mvn:commons-logging/commons-logging/1.1.1</bundle>
> > </feature>
> >
> > <feature description="PostgreSQL Data Source"
> version="3.0.0-SNAPSHOT" name="PostgresDS">
> > <feature version="${pom.version}">datasource</feature>
> > <bundle>wrap:mvn:postgresql/postgresql/8.4-701.jdbc4</bundle>
> > <config name="datasource">
> > jdbc.driverClassName=org.postgresql.Driver
> > jdbc.url=jdbc:postgresql:metc
> > jdbc.username=metc
> > jdbc.password=pw4metc
> > </config>
> > </feature>
> > </features>
> >
>
> Hope that helps.
>
> Brian
>
> On Aug 30, 2012, at 9:38 AM, Mark Ashworth <mp...@gmail.com> wrote:
>
> > Good day,
> >
> > I come from a JEE environment that is primarily dominated by EJB, JPA and
> > JSF and I have found that many of these heavy weight approaches do not
> work
> > so well. For example, I tried JSF but found that the Apache Wicket
> library
> > together with Pax-Wicket was a far better approach.
> >
> > I am now trying to determine the best database access strategy to use so
> if
> > there are any suggestions that would most appreciated.
> >
> > Regards,
> > Mark P Ashworth
> > http://mpashworth.wordpress.com
> >
> >
> >
> > --
> > View this message in context:
> http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883.html
> > Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
--
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com
Re: Best database access strategy to use in OSGi environment
Posted by Brian Topping <to...@codehaus.org>.
Mark,
I did a lot of research on this and found that OpenJPA with Apache Aries is the best way to go. Aries supports a few different JPA providers (not Hibernate for various technical reasons), OpenJPA seemed to be the best of them.
Then, by making the datasource it's own bundle, I set configuration in the feature so that just by changing the feature, the database is reconfigured between providers such as PostgreSQL or MySQL. This allows specific users to select which database they want to use and have it configured properly just by selecting the proper feature to compliment OpenJPA with. For instance:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="datasource">
> <repository>mvn:org.apache.karaf.features/enterprise/3.0.0-SNAPSHOT/xml/features</repository>
> <feature description="Datasource" version="1.0.0-SNAPSHOT" name="datasource">
> <feature>jndi</feature>
> <feature>transaction</feature>
> <bundle>wrap:mvn:com.experlog/xapool/1.5.0</bundle>
> <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
> <bundle>mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0</bundle>
> <bundle>wrap:mvn:aopalliance/aopalliance/1.0</bundle>
> <bundle>wrap:mvn:commons-logging/commons-logging/1.1.1</bundle>
> </feature>
>
> <feature description="PostgreSQL Data Source" version="3.0.0-SNAPSHOT" name="PostgresDS">
> <feature version="${pom.version}">datasource</feature>
> <bundle>wrap:mvn:postgresql/postgresql/8.4-701.jdbc4</bundle>
> <config name="datasource">
> jdbc.driverClassName=org.postgresql.Driver
> jdbc.url=jdbc:postgresql:metc
> jdbc.username=metc
> jdbc.password=pw4metc
> </config>
> </feature>
> </features>
>
Hope that helps.
Brian
On Aug 30, 2012, at 9:38 AM, Mark Ashworth <mp...@gmail.com> wrote:
> Good day,
>
> I come from a JEE environment that is primarily dominated by EJB, JPA and
> JSF and I have found that many of these heavy weight approaches do not work
> so well. For example, I tried JSF but found that the Apache Wicket library
> together with Pax-Wicket was a far better approach.
>
> I am now trying to determine the best database access strategy to use so if
> there are any suggestions that would most appreciated.
>
> Regards,
> Mark P Ashworth
> http://mpashworth.wordpress.com
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Best-database-access-strategy-to-use-in-OSGi-environment-tp4025883.html
> Sent from the Karaf - User mailing list archive at Nabble.com.