1 2 Previous Next 18 Replies Latest reply on May 22, 2013 3:25 AM by Michael Illgner

    Universal Connection Pooling in JBoss 7.1.1

    Sanjeev Shrestha Novice

      Can I get a simple example to use universal connection pooling in JBoss 7.1.1 . I have simply searched everywhere on the web but cannot find appropriate examples. I would be very thankful for your help. Thank you!!! Hope I get a reply soon. Do I have to configure the standalone. xml for this and if so how shall I do it. I have been trying for so long and fearit may not be supported at all.

        • 1. Re: Universal Connection Pooling in JBoss 7.1.1
          Jesper Pedersen Master

          Connection pool of what ?  Take a look at http://www.jboss.org/ironjacamar and model your ManagedConnection with the functionality you are look for. Then deploy that resource adapter to AS7 with the pooling requirements you want.

          • 2. Re: Universal Connection Pooling in JBoss 7.1.1
            Sanjeev Shrestha Novice

            I was trying to connect to oracle database. It was working with previous JBoss 4.2.0 GA but here people say I have to change standalone.xml and I'm getting plain confused. Thank you for the fast reply and for your help. I will try as soon as possible and paste the output

            • 4. Re: Universal Connection Pooling in JBoss 7.1.1
              Sanjeev Shrestha Novice

              Sir,

               

              What i m trying to implement is similar to this example.

               

              http://theblasfrompas.blogspot.com/2011/08/using-oracle-universal-connection-pool.html

               

              But when I tried doing it. The connection just wouldn't come in JBoss as 7.1.1 . I was just asking if I could use for a similar configuration. The advantage would be that I dont have to change the standalone.xml. Thank you for the quick reply. I am new to this and I don't know the difference between Xa datasource and non xa datasource.

              • 5. Re: Universal Connection Pooling in JBoss 7.1.1
                Justin Bertram Master

                Are you trying to levarage any of the Oracle-specific features from their Universal Connection Pool?  If so, you probably won't want to use the JBoss JCA JDBC connection pool because it is provider-agnostic and doesn't support the Oracle-specific features that Oracle's UCP provides.  That means you won't be configuring the datasource in standalone*.xml

                 

                I have a few more questions...

                 

                 

                But when I tried doing it.

                What specifically did you try and what was the result?

                 

                The connection just wouldn't come in JBoss as 7.1.1 .

                What does that mean?

                 

                I was just asking if I could use for a similar configuration.

                Similar in what sense?  Both the JBoss JCA JDBC pooling and Oracle's UCP support basic connection pool functionality, but Oracle's UCP has Oracle-specific features that we don't provide.

                 

                The advantage would be that I dont have to change the standalone.xml.

                Why is that an advantage?

                • 6. Re: Universal Connection Pooling in JBoss 7.1.1
                  Sanjeev Shrestha Novice

                  Hello Justin,

                   

                  I was trying to implement UCP but I got stuck. I have a thread about it

                  https://community.jboss.org/thread/201280?start=30&tstart=0

                   

                  The specific problem is JBoss gets stuck in here

                  Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.1)

                   

                  I tried to hot deploy the ojdbc_6.jar

                   

                  What we have in our project is that there is a xml file that is read for connection and the corresponding connections are made automatically. I'm currently working on Weblogic 12c and the xml file is parsed and the connection pool is made readily available but this was not the case in JBoss 7.1.1.

                   

                  As you said "Oracle's UCP has Oracle-specific features that we don't provide" does this mean that the ucp.jar's functionality cannot be used?

                   

                  I am working with oracle 11g(ojdbc_6.jar).

                   

                  For ojdbc driver

                  http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

                   

                  For ucp driver

                  http://www.oracle.com/technetwork/database/enterprise-edition/downloads/ucp-085009.html

                   

                  The advantage would be the simplicity. I would or any one in my team would not have to configure the standalone.xml and that would be greatly helpful.

                   

                  I hope this explains all my findings. Thank you guys for the immediate response.

                   

                  I'm just trying to figure out why it runs in jboss 4.2.0 GA without any issue and why in this new server it gets stuck.(Please look the forum for more info.)

                  • 7. Re: Universal Connection Pooling in JBoss 7.1.1
                    Justin Bertram Master

                    I can't really help you with the Oracle driver issue you're having because I don't have access to an instance of Oracle.  However, I can say that this is a fairly well-documented process (refer to Jesper's link above) and lots of users have set up JDBC datasources to lots of different databases - including Oracle.  I assume that you will be able to configure an Oracle JDBC datasource in standalone*.xml as well after a thorough review of the documentation.

                     

                    My main point is that even once you configure a JDBC datasource you still will not be able to leverage the Oracle specific functionality of the UCP.  To my knowledge, the UCP was not designed to be used underneath a JCA JDBC datasource which provides its own pooling.

                     

                    As for the advantage of simplicity which you detailed, I still don't understand why not having to edit standalone*.xml would be that much simlper.  However, if you really want to deploy your datasource apart from standalone*.xml you can.  This is discussed in the documentation which Jesper linked above.  The caveat with that is the datasource cannot then be managed by any of the management tools built-in to JBoss AS 7 (i.e. web console, CLI, HTTP API, etc.).

                    1 of 1 people found this helpful
                    • 8. Re: Universal Connection Pooling in JBoss 7.1.1
                      Sanjeev Shrestha Novice

                      Ok Thank you for the information you provided. It was helpful. I think your explanation very well explains the problem I am having. I just hoped that I would not have to make changes for datasource connection in the server files.

                       

                      Thank you for your help. I am going to try to resolve this problem and if I succeed I will post my solution.

                      • 9. Re: Universal Connection Pooling in JBoss 7.1.1
                        source dev Newbie

                        Hi,

                         

                        Might have missed the boat here but if you are trying to set-up a Universal Connection Pool under JBoss, you may need to write your own service to implement and expose the pool.  We did this on JBoss 4.x and are currently porting to JBoss 6 EAP.  My feeling is that we will have to do the same again. 

                         

                        The solution we used is here: https://forums.oracle.com/forums/thread.jspa?threadID=1062170.

                         

                        Am hoping we can do the same for JBoss 6 EAP. 

                         

                        Justin, the reason we did this is because we couldn't set some of the custom UCP properties when configuring the pools directly in JBoss for a *non-XA datasource*.  For XA datasources, we used the <xa-datasource-property> tag and it worked okay.  Can't remember why it didn't for non-xa - perhaps the properties weren't passed to the wrapped UCP pool.  Anyway, these custom properties were required for RAC fast failover against an Oracle DB.  If there's an easier approach in JBoss 6 EAP, be happy for someone to point me in the right direction.

                         

                        Cheers,

                         

                        Alex

                        • 10. Re: Universal Connection Pooling in JBoss 7.1.1
                          Justin Bertram Master

                          To my knowledge, the MBean approach (while not the most elegant) should still work in EAP 6.

                           

                          To your point about not being able to set all the properties, that is not the fundamental problem in my view.  The fundamental problem is that the Oracle UCP is itself a pool and therefore reproduces a key bit of funcationality from the JCA JDBC datasource so as to make the two incompatible.

                          • 11. Re: Universal Connection Pooling in JBoss 7.1.1
                            source dev Newbie

                            Hi Justin,

                             

                            Agree that the design of Oracle's UCP solution is the issue here - was just trying to answer your question about why the 'easier' route of editing the standalone.xml may not be feasible. Unfortunately the Oracle UCP issue is an issue I have to work around somehow so, for me at least, it is *my* fundamental problem.

                             

                            I tried the MBean method but got hit by the old "JBAS011859: Naming context is read-only" issue mentioned here.  Not sure there is much I can do about that one....

                             

                            You mention the MBean approach is not the most elegant anyway.  Do you have an alternative in mind that I should be looking at?  Perhaps this?  Looks doable but I'll need to figure out how to pass in the property config for the pool.

                             

                            Ultimately I can't use the JBoss JCA JDBC datasource configuration since it is not designed to support warpping a pool and setting properties on that wrapped pool.  Fair enough - not a complaint - I just need to find a way forward to define a pool datasource myself, then bind it.

                             

                            BTW, I couldn't grasp how Jesper's link would me in this situation - maybe I missed something.

                             

                            Cheers,

                             

                            Alex

                            • 12. Re: Universal Connection Pooling in JBoss 7.1.1
                              Justin Bertram Master

                              You mention the MBean approach is not the most elegant anyway.  Do you have an alternative in mind that I should be looking at?

                              I was thinking of a proper AS7 subsystem which would support the creation and configuration of the Oracle UCP.

                              • 13. Re: Universal Connection Pooling in JBoss 7.1.1
                                Sanjeev Shrestha Novice

                                Hello Source Dev,

                                 

                                Thank you for posting an immediate solution. Still have to test it though. I think it would help if we had features of Oracle UCP embedded in JBoss as 7. It would help so many users like us. "Who love JBoss" but cant UCP to work on no later than Jboss 4.2.0.

                                 

                                Thank you for the help guys.

                                 

                                I hope I can get more help in this topic.

                                 

                                -Sanjeev

                                • 14. Re: Universal Connection Pooling in JBoss 7.1.1
                                  source dev Newbie

                                  Hi,

                                   

                                  Just to follow up.... 

                                   

                                  Ultimately I got this working by binding the UCP using a ServiceActivator.  Works ok.  I only need to do this for the non-XA datasources since JBoss allows properties to configured on XA datasources that it wraps.  Not sure why there is that inconsistency but it's been there since JBoss 4.x so I assume it's by design.  Perhaps it's that for non-XA, JBoss doesn't actually wrap a 'datasource' class?  Hard to tell as the documentation for a non-XA Oracle datasource shows the non-XA datasource driver containing an <xa-datasource-class> tag, which seems a little odd, and I don't see a <datasoruce-class> equivalent.

                                   

                                  So to summarise the workaround to allow ONS properties to be set on the Oracle 'Pool Datasources':

                                  - Non-XA datasources: create your own UCP and bind using ServiceActivator

                                  - XA datasources: configure in JBoss using the oracle.jdbc.xa.client.OracleXADataSource class (which is actually a pool) and set properties using xa-datasource-property.

                                   

                                  I guess if JBoss allowed properties to be set on wrapped non-XA datasource (if it does actually wrap them), you could use the JBoss config route for both XA and non-XA.  Also, keep in mind that, with this workaround for XA datasources, we have a JBoss pool wrapping an Oracle pool, which isn't ideal.

                                   

                                  Cheers,

                                   

                                  Alex

                                  1 2 Previous Next