Topic
25 replies Latest Post - ‏2013-09-25T13:39:28Z by leealber
Tunisiano
Tunisiano
1 Post
ACCEPTED ANSWER

Pinned topic JPA and websphere 7

‏2009-12-22T16:40:56Z |
Hi EveryBody,
I want to know if we are obliged to use OpenJPA if we use go with Webpshere 7 .
is it possible to use hibernate or topliknk as JPA Provider inside websphere 7 instead of the websphere JPA implementation(oopen JPA)
is there any special config to perform on websphere 7 to do that( to disable Open JPA as JPA provider?) ?
thanks in advance
Updated on 2012-10-24T15:04:14Z at 2012-10-24T15:04:14Z by leealber
  • leealber
    leealber
    19 Posts
    ACCEPTED ANSWER

    Re: JPA and websphere 7

    ‏2009-12-22T17:23:24Z  in response to Tunisiano
    Try this link in WAS 7.0 InfoCenter:

    http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/tejb_configpp.html

    Albert Lee.
    • sutter
      sutter
      93 Posts
      ACCEPTED ANSWER

      Re: JPA and websphere 7

      ‏2009-12-22T18:11:32Z  in response to leealber
      Albert's reply gives you the details on how to configure an alternate JPA provider.

      Just to provide a bit more background... The Java EE 5 family of specifications require a Container to allow for alternate JPA providers to be configured. Although WebSphere does ship their JPA implementation based on Apache OpenJPA, WebSphere also needs to allow for the configuration and usage of an alternate JPA provider, such as Hibernate or EclipseLink.

      A couple of things to be aware of if you go this path...

      o If an alternate provider is configured, the support stops at the contract between the Container and the alternate Provider. If you experience any problems with using an alternate JPA provider, you will need to isolate the problem to either the WebSphere Container or the alternate JPA provider. If the problem exists in the Container, then of course we will continue to support the customer and attempt to resolve the issue. If the problem is with the alternate JPA provider, then the customer will have to work with that project's support structure to get resolution.

      o Related to this item is the cost of support. Any problems found with the WebSphere JPA solution (including Apache OpenJPA) are covered as part of your normal WebSphere licensing. No additional support contracts are needed.

      o The WebSphere performance benchmarks are using the WebSphere JPA solution, based on Apache OpenJPA. So, if you are looking for the world-class performance benchmark results, you'll want to stick with the WebSphere JPA solution. Any other JPA provider could provide completely different results.

      o The WebSphere JPA extensions (DB2 optimizations, integration with pureQuery, integration with Extreme Scale, etc) only work with the Apache OpenJPA that we provide. If you decide to use an alternate JPA provider, none of the WebSphere JPA extensions will be available.

      If you can't tell, we'd love to convince you to stick with (or at least try) the WebSphere JPA solution before jumping ship to an alternate JPA provider. :-)

      Thanks,
      Kevin
      • SystemAdmin
        SystemAdmin
        45 Posts
        ACCEPTED ANSWER

        Re: JPA and websphere 7

        ‏2010-08-04T07:30:19Z  in response to sutter
        Kevin : do you have any performance benchmarks that compares Hibernate to Apache OpenJPA to WebSphereJPA ?
        • ShekUp
          ShekUp
          1 Post
          ACCEPTED ANSWER

          Re: JPA and websphere 7

          ‏2010-08-04T08:04:45Z  in response to SystemAdmin
          I have used Oracle Toplink.. EclipseLink is Toplink Essentials.
          I see lot of difference between JPA and toplink.
          Toplink is a product. Toplink has its own configuration files, and different API.
          Toplink Essentials is open source, a kind of subset of Toplink.
          OpenJPA is true implementation of JPA.
          For using Toplink, JDeveloper is the best product.
          Using Toplink inside any other IDE, other than JDeveloper is not easy.
          Even when there would be support.
        • sutter
          sutter
          93 Posts
          ACCEPTED ANSWER

          Re: JPA and websphere 7

          ‏2010-08-04T13:24:55Z  in response to SystemAdmin
          Hi oddaolse,
          Benchmarks are tricky business. More often than not, "benchmarks" tend to favor one vendor over another. Whether you are talking about hardware, software, application servers, or even JPA providers.

          SpecJEnterprise2010 [1] is an industry benchmark that encompasses many aspects of the application server environment, with a focus on the persistence framework. It is estimated that 75-80% of this benchmark depends on the persistence provider implementation that is being utilized.

          IBM WebSphere has continued it's leadership with this benchmark. Even when a competitor comes out with some results that beat our posted benchmark, you can be assured that we are already working on our next publish that will again put us on top.

          The latest results posted by IBM WebSphere [2] are utilizing the latest OSGi/JPA 2.0 Feature Pack [3]. These are fantastic results that even beat our previous publish by 50-70%!

          (Neither of our main competitors, Oracle with EclipseLink and JBoss with Hibernate, have posted any results thus far...)

          How much of this performance boost is due to the WebSphere JPA solution over and above Apache OpenJPA? Up until this latest OSGi/JPA Feature Pack, the answer was zero. We've been working on the base Apache OpenJPA infrastructure to ensure that it's the best performing open-source alternative on the market. With the introduction of the OSGi/JPA Feature Pack, we have provided one extension in the WebSphere JPA solution that gave us some boost -- a read-only object cache [4]. Although the use of this cache is not for every application, it did help out the SpecJEnterprise application. Other than that feature, all of the rest of the performance improvements are in the base Apache OpenJPA offering.

          As far as comparing our JPA solution directly against the Hibernates and EclipseLinks... We do that with internal benchmarks all the time. But, since these are not industry standard benchmarks, we are not allowed to publicly share the results. We have even used WebSphere with an alternate JPA provider (Hibernate and EclipseLink) for the SpecJEnterprise runs to see how our JPA solution stacks up. In all of these cases, you'll have to trust me that we continue to come out on top... :-)

          Bottom line is that every application, every environment is slightly different. It's extremely difficult to compare one JPA provider to another because of all of the variables. Based on our published SpecJEnterprise results, you can be assured that we are doing everything to keep our JPA solution the best performing solution available.

          Good luck with your comparisons!

          Kevin
          [1] http://www.spec.org/jEnterprise2010/
          [2] http://www.spec.org/jEnterprise2010/results/res2010q2/
          [3] http://www-01.ibm.com/software/webservers/appserv/was/featurepacks/osgi/
          [4] http://publib.boulder.ibm.com/infocenter/wasinfo/fep/topic/com.ibm.websphere.jpafep.multiplatform.doc/info/ae/ae/tejb_jpaobjectcache.html
          • SystemAdmin
            SystemAdmin
            45 Posts
            ACCEPTED ANSWER

            Re: JPA and websphere 7

            ‏2010-08-05T07:45:42Z  in response to sutter
            Thank you for your reply! It was informative.
            I think that there are more WAS customers than us who are trying to figure out which JPA provider to use. Even if everyone knows that WAS is bundled with WebSphere JPA and Apache OpenJPA. And even if the customers are aware of the benefits regarding support if they use the bundled JPA provider - they still are a bit uncertain of what to use.

            And articles like http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html where the conclusion states "Hibernate is one of several persistence frameworks that can be successfully used with WebSphere Application Server to provide the object-relational mapping to entity data stored in relational databases" surely does not give any clear advice (regarding performance) to use WebSphere JPA. The article is very good by the way - so do not get me wrong here. It is nothing wrong with the paper. It just adds to my uncertainty regarding the choise of JPA provider.

            Again - thank you for your reply.
            • sutter
              sutter
              93 Posts
              ACCEPTED ANSWER

              Re: JPA and websphere 7

              ‏2010-08-05T13:27:40Z  in response to SystemAdmin
              Hi oddaolse,
              You have hit on several of the reasons why it makes the most sense to stick with the WebSphere JPA solution. Besides the performance aspect that I already posted about, there is also the ease-of-use (bundling) and support cost aspect. Apache OpenJPA is bundled with WebSphere as an integral part of the overall WebSphere JPA solution. We have added several extensions and features beyond the base OpenJPA binary, but the basic binaries are exactly the same. So, if you have written any applications using Apache OpenJPA, you can be assured that these applications will continue to execute within the WebSphere JPA environment.

              With the WebSphere JPA solution, you are also getting full IBM support from beginning to end. If there is a problem discovered in OpenJPA, my team has full access to the OpenJPA project, we will fix it and provide an iFix and/or fixpack to resolve the issue in the WebSphere deliverable. If you decided to go with an alternate JPA provider, the IBM support ends at the defined JPA plug point. If the problem is determined to be in the alternate JPA provider, it is left up to the user to work with that provider to figure out the proper fix.

              As far as Tom and friends' article... You have to put that article into proper context. It was written in 2006 (re-posted in 2010). The JPA 1.0 specification didn't even publish until mid 2006. At that time, there was a lot of pressure on WebSphere to work with these alternate frameworks like Hibernate and Spring. But, now that these types of frameworks are being standardized, IBM is basing it's own solutions on JPA and OSGi. Thus, one of the reasons for the OSGi and JPA 2.0 Feature Pack. See how it all comes around? :-)

              (Also, I know that if you contacted any of the authors of that article, they would now recommend our WebSphere JPA solution over Hibernate.)

              I appreciate the dialog. And, my apologies for the "confusing messages". I hope that you and the other WAS customers that are examining the JPA providers will come to realize that we have provided an extremely competitive offering and it's already bundled and tested within the WebSphere environment.

              Good luck,
              Kevin
  • CA2F_Pavan_Achanta
    CA2F_Pavan_Achanta
    2 Posts
    ACCEPTED ANSWER

    Re: JPA and websphere 7

    ‏2010-08-05T18:54:22Z  in response to Tunisiano
    We were finally able to use Hibernate as JPA provider after a lot of trial and error.

    This is what we did on our server (7.0.0.11 with EJB Feature pack installed)

    1. Put following jars in :

    /apps/IBM/WebSphere/AppServer/lib/app/
    antlr-2.7.6.jar commons-digester-1.7.jar commons-logging-1.0.4.jar hibernate-commons-annotations.jar jta-1.1.jar
    cglib-2.2.jar commons-email-1.0.jar commons-validator-1.3.0.jar lucene-core-2.2.4.1.jar
    commons-beanutils-1.7.0.jar commons-fileupload-1.2.1.jar dom4j-1.6.1.jar hibernate-entitymanager.jar oro-2.0.8.jar
    commons-chain-1.1.jar commons-httpclient-3.0.1.jar ehcache-1.2.3.jar hibernate-search-3.1.1.GA.jar slf4j-api-1.5.8.jar
    commons-codec-1.3.jar commons-io-1.4.jar hibernate3.jar hibernate-validator.jar slf4j-api.jar
    commons-collections-3.1.jar commons-lang-2.4.jar hibernate-annotations.jar javassist-3.9.0.GA.jar slf4j-jdk14-1.5.2.jar

    Note: we do not include ejb3-persistence.jar anywhere because this is loaded by WAS server.
    Do not package any of these jars in the application EAR file.

    2. Add this line to persistence.xml:

    <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
    3. And use the option "Classes loaded with local class loader first (parent last)" under
    Enterprise Applications > Your App > Class loader

    Can someone point us to some formal documentation on how the JPA bootstraping happens in WAS 7 server??
    Just trying to understand..
    • sutter
      sutter
      93 Posts
      ACCEPTED ANSWER

      Re: JPA and websphere 7

      ‏2010-08-05T19:30:59Z  in response to CA2F_Pavan_Achanta
      Hi CA2F_Pavan_Achanta,
      You mention 7.0.0.11 with the EJB Feature Pack installed... This doesn't quite make sense. The EJB3 Feature Pack was for WebSphere v6.1. All of the EJB3 and JPA 1.0 was integrated into the WebSphere v7 stream, so there is no need for an "EJB Feature Pack". Unless you were referring to the OSGi/JPA 2.0 Feature Pack??? Clarification, please.

      Yeah, we found the packaging of Hibernate to be quite daunting ourselves. We had to verify that alternate JPA providers work in the WebSphere environment, and Hibernate JPA was definitely a challenge to get right for our test efforts. Our test team documented some of their experience in a white paper [1].

      Configuring alternate 3rd party JPA providers is documented in the InfoCenter [2]. Is this what you requested when you asked about the JPA bootstrapping information? There are multiple ways for your application to obtain access to an alternate provider. It depends on your environment and needs.

      Again, we would encourage everyone to use the WebSphere JPA solution instead of Hibernate. As you can see, it's much easier to use and configure. :-) And, if there are compelling reasons why you are using Hibernate JPA instead, we'd like to hear about them. Thanks.

      Hope this helps,
      Kevin

      [1] https://www.ibm.com/developerworks/mydeveloperworks/wikis/form/anonymous/api/library/53181ccd-bcd4-431f-b968-0b5f6d46d652/document/192a432b-28bb-4080-b037-345e5d83da76/attachment/61e74f67-1d60-4120-ba25-ad7264c9f4f6/media/AlternateJPAProviders_TestReport.pdf
      [2] http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.zseries.doc/info/zseries/ae/tejb_jpa3rdparty.html
      • CA2F_Pavan_Achanta
        CA2F_Pavan_Achanta
        2 Posts
        ACCEPTED ANSWER

        Re: JPA and websphere 7

        ‏2010-08-05T21:57:06Z  in response to sutter
        Kevin,

        The white paper is very informative! It covers every detail.
        I wish I had it back in early june when I wasted 2 weeks trying to get Hibernate or any JPA work..

        And regarding EJB3 Feature pack.. are you sure? we do have a base version of WAS 7 without EJB3 Feature pack..
        We had to delete the default profile created while installing WAS ,upgrade the Server with EJB3 Feature pack and then recreate the profile. That took care of the MBean mapping issues that we had.

        Also I forgot to mention these 2 lines that we need to include in persistence.xml file:

        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/xxxxx</jta-data-source>

        It is important to get the jars right and the class loader order also affects.
        I will test openJpa when I have time..

        Thanks,
        Pavan
        • sutter
          sutter
          93 Posts
          ACCEPTED ANSWER

          Re: JPA and websphere 7

          ‏2010-08-05T22:35:50Z  in response to CA2F_Pavan_Achanta
          Hi Pavan,
          We must be talking about different "feature packs". The EJB3 Feature Pack [1] is definitely only for the WebSphere v6.1 environment. All of this function was integrated into the WebSphere v7 deliverable. So, WAS v7.0.0.x contains all of the EJB 3.0 and JPA 1.0 functionality without any additional "feature packs".

          The OSGi and JPA 2.0 Feature Pack [2] does sit on top of the WebSphere v7.0.0.x deliverable. This feature pack provides the functionality and support for the latest JPA 2.0 specification.

          What level of Hibernate JPA are you attempting to use? Their JPA 1.0 implementation or their JPA 2.0 implementation (which I believe is v3.5)?

          Anyway, good luck with your comparisons and experimentation. Let us know if hit any snags.

          Thanks,
          Kevin

          [1] http://www-01.ibm.com/software/webservers/appserv/was/featurepacks/ejb/
          [2] http://www-01.ibm.com/software/webservers/appserv/was/featurepacks/osgi/
          • infyRavi
            infyRavi
            14 Posts
            ACCEPTED ANSWER

            Re: JPA and websphere 7

            ‏2011-06-17T14:10:43Z  in response to sutter
            Hi,
            we want to use JPA 2.0 implementation on WAS 7.x. After reading the posts till now I came we know that we have to use OSGI/JPA feature pack to use JPA 2.0 features.
            I am having the following questions
            1) We are currently on WAS 7.0.0.9, can we install this OSGi/JPA FeP on top of this directly or do we need to move to some higher
            level before we do it.
            2) If we want to use Hibernate 3.6 which provides JPA 2.0 implementation what steps we need to follow. Do we need this OSGi/JPA FeP then also?

            Thanks
            Ravi
            • sutter
              sutter
              93 Posts
              ACCEPTED ANSWER

              Re: JPA and websphere 7

              ‏2011-06-17T15:37:17Z  in response to infyRavi
              Hi Ravi,
              Many of the same people my team monitor these forums related to JPA... So, you're going to get similar answers. :-)

              1) Yes, the OSGi/JPA 2.0 FeP can be installed on top of 7.0.0.9.

              2) Yes, you have to install the OSGi/JPA 2.0 FeP before you can attempt to use an alternate JPA 2.0 provider, such as Hibernate. Basic runtime infrastructure needs to be in place before an alternate JPA 2.0 provider can be used. The FeP provides this infrastructure.

              I would be remiss if I didn't ask this question: Why is the use of Hibernate mandatory? Is there some feature in Hibernate 3.6 that is not present in the IBM JPA solution? I have a short article [1] that asks the same question.

              [1] http://www.ibm.com/developerworks/websphere/techjournal/1008_col_sutter/1008_col_sutter.html

              Thanks,
              Kevin Sutter, JPA Architect, IBM WebSphere
              • infyRavi
                infyRavi
                14 Posts
                ACCEPTED ANSWER

                Re: JPA and websphere 7

                ‏2011-06-18T18:00:13Z  in response to sutter
                Hi,
                After reading all the posts and IBM supports for Open JPA we have decided to go with OPEN JPA which comes with WAS.
                We are using RAD 7.5 for our development purpose and we are on 7.0.0.9 and when we tried to install this OSGI/JPA Feature pack we are getting the following error as mentioned in the attached doc.Can you please advice what should we do here.

                Thank
                Ravi

                Attachments

                • infyRavi
                  infyRavi
                  14 Posts
                  ACCEPTED ANSWER

                  Re: JPA and websphere 7

                  ‏2011-06-20T13:28:41Z  in response to infyRavi
                  Hi Sutter,
                  I read in one of the posts in developerworks that we need to be on RAD 8.0 to install OSGi/JPA 2.0.
                  If we upgrade to RAD 8.0 will we able to install this FEP ?

                  Thanks
                  Ravi
                  • SystemAdmin
                    SystemAdmin
                    45 Posts
                    ACCEPTED ANSWER

                    Re: JPA and websphere 7

                    ‏2011-06-20T13:55:26Z  in response to infyRavi
                    Hi Ravi,

                    RAD 8.0 supports the OSGi/JPA 2.0 FeP. http://www-01.ibm.com/software/awdtools/developer/application/features/index.html?S_CMP=wspace

                    Best regards,
                    Michael Dick
                • SystemAdmin
                  SystemAdmin
                  45 Posts
                  ACCEPTED ANSWER

                  Re: JPA and websphere 7

                  ‏2012-10-24T14:32:17Z  in response to infyRavi
                  Hi,

                  I'm looking at your posts and they are helping me, thanks. The problem I still observe is that after the installation of the feature pack for OSGI and JPA2, I still get the error about the version number of the persistence that must be 1.0, cannot be 2.0. Sounds like the feature pack is installed but not active, and so I cannot run on JPA 2. Any hint on why this continues to happen after apparently all the steps have been done ? I'm running WAS 7, RAD 8.

                  Thanks,

                  Stefano.
                  • leealber
                    leealber
                    19 Posts
                    ACCEPTED ANSWER

                    Re: JPA and websphere 7

                    ‏2012-10-24T15:04:14Z  in response to SystemAdmin
                    After you have installed the JPA FeP, you have to create a new profile to activate the JPA 2 features.

                    Albert Lee.
                    • MSSK_Greg_Roberts
                      MSSK_Greg_Roberts
                      1 Post
                      ACCEPTED ANSWER

                      Re: JPA and websphere 7

                      ‏2013-09-25T00:57:57Z  in response to leealber

                      Albert,

                      I currently working on getting JPA 2 running on a WAS 7.0.0.9 server that has the OSGi and JPA 2 FeP installed. I'm confused by your comment above. Do I need to create a new Profile? My understanding was that I only needed to augment the Profile after the Fep install.

                      Thanks

                      Greg

                      • leealber
                        leealber
                        19 Posts
                        ACCEPTED ANSWER

                        Re: JPA and websphere 7

                        ‏2013-09-25T13:39:28Z  in response to MSSK_Greg_Roberts

                        Greg,

                        You are correct. You can either augment an existing profile or create a new profile using the JPA profile template.

                        Hope this clarify the previous answer.

                        Albert.

              • rickyteja
                rickyteja
                3 Posts
                ACCEPTED ANSWER

                Re: JPA and websphere 7

                ‏2011-07-13T19:11:30Z  in response to sutter
                Hi Sutter,

                one of our application installation document says

                " The WebSphere Application Server V7 Feature Pack for OSGi Applications and Java Persistence API 2.0 is required when using WebSphere 7.x "

                what is this feature pack?

                doesn't this come with app server?

                Do we need to install this separately?

                Please let me know where can i download this and how install this on present environment. we are using 7.0.0.17 base.

                This will help me a lot

                thanks in advance
                • sutter
                  sutter
                  93 Posts
                  ACCEPTED ANSWER

                  Re: JPA and websphere 7

                  ‏2011-07-13T20:09:59Z  in response to rickyteja
                  Hi,
                  Not sure which "installation document" you are referring to, but the OSGi and JPA 2.0 Feature Pack installs on top of WAS v7.0.0.x. This Feature Pack is necessary in order to use JPA 2.0 functionality in a WAS v7 environment. Without this Feature Pack, you will be limited to JPA 1.0 level of functionality.

                  More information on the Feature Pack can be found here:
                  http://www-01.ibm.com/software/webservers/appserv/was/featurepacks/osgi/

                  Hope this helps,
                  Kevin Sutter, JPA Architect, IBM WebSphere
                  • SystemAdmin
                    SystemAdmin
                    45 Posts
                    ACCEPTED ANSWER

                    Re: JPA and websphere 7

                    ‏2011-09-23T09:53:37Z  in response to sutter
                    I wrote a post showing how to run JPA2.0 under Websphere 7 without putchasing the "OSGI & JPA2.0 Feature Pack".

                    Find it at http://larims.wordpress.com/2011/09/17/running-jpa2-0-under-websphere7
                    • leealber
                      leealber
                      19 Posts
                      ACCEPTED ANSWER

                      Re: JPA and websphere 7

                      ‏2011-09-23T12:50:36Z  in response to SystemAdmin
                      Isn't true that "JPA & OSGI Feature Pack" is free for download for WAS 7.0 customer?

                      Albert Lee
                      • sutter
                        sutter
                        93 Posts
                        ACCEPTED ANSWER

                        Re: JPA and websphere 7

                        ‏2011-09-23T13:08:48Z  in response to leealber
                        You are correct. The OSGi/JPA 2.0 Feature Pack is a free download (as are all Feature Packs) for all registered WebSphere Application Server v7.0 users.

                        I took a quick look at the previous posting about how to run an alternate JPA 2.0 provider on WAS v7 without the Feature Pack. Personally, I would not recommend that approach. If you are interested in using an alternate JPA 2.0 provider (ie. Hibernate or EclipseLink), then I would still recommend installing the OSGi/JPA 2.0 Feature Pack and then follow the instructions in the InfoCenter for configuring an alternate JPA provider.

                        Thanks,
                        Kevin Sutter, JPA Architect, IBM WebSphere