How to start/stop/reset connection pool by java program in AS7?

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

How to start/stop/reset connection pool by java program in AS7?

Bill Hong (Gong)

Hi,

 

The functionalities to start/stop/reset a connection pool are not available in AS 7 “Admin Console” any more. Besides, it seems the MBean service “jboss.jca.ManagedConnectionPool” is removed. Therefore, the previous approach in AS6 won’t work now. I can’t find any relevant documents to explain how to get the instance of “ManagedConnectionPool” in As7 and perform those actions in a java program. Can anyone give me some suggestions or clues to work it out please?

 

Thanks in advance!

 

Regards,

Bill



CONFIDENTIALITY NOTICE
This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

Jesper Pedersen
On Monday, August 15, 2011 07:27:24 AM Bill Hong (Gong) wrote:
> The functionalities to start/stop/reset a connection pool are not available
> in AS 7 "Admin Console" any more.

The admin console isn't done yet - use the command line client to see the
functionality that is available today:

 https://docs.jboss.org/author/display/AS7/Admin+Guide

> Besides, it seems the MBean service
> "jboss.jca.ManagedConnectionPool" is removed.

There are no MBean's for the managed connection pools in AS 7.

> Therefore, the previous
> approach in AS6 won't work now. I can't find any relevant documents to
> explain how to get the instance of "ManagedConnectionPool" in As7 and
> perform those actions in a java program. Can anyone give me some
> suggestions or clues to work it out please?

You need to use the management API to perform those operations.

Questions belong in the user forum:
http://community.jboss.org/en/jbossas/as7_users

Best regards,
 Jesper
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

jtgreene
Administrator
On 8/15/11 2:30 PM, Jesper Pedersen wrote:
> The admin console isn't done yet - use the command line client to see the
> functionality that is available today:

It obviously can't flush a db pool if there isn't a management operation
to do that.

--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

jtgreene
Administrator
On 8/15/11 2:52 PM, Jason T. Greene wrote:
> On 8/15/11 2:30 PM, Jesper Pedersen wrote:
>> The admin console isn't done yet - use the command line client to see the
>> functionality that is available today:
>
> It obviously can't flush a db pool if there isn't a management operation
> to do that.

BTW to avoid misleading everyone I will say that the admin console
displays nearly everything (if not everything) the JCA subsystem
currently exposes.

--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

jtgreene
Administrator
On 8/15/11 2:54 PM, Jason T. Greene wrote:

> On 8/15/11 2:52 PM, Jason T. Greene wrote:
>> On 8/15/11 2:30 PM, Jesper Pedersen wrote:
>>> The admin console isn't done yet - use the command line client to see
>>> the
>>> functionality that is available today:
>>
>> It obviously can't flush a db pool if there isn't a management operation
>> to do that.
>
> BTW to avoid misleading everyone I will say that the admin console
> displays nearly everything (if not everything) the JCA subsystem
> currently exposes.

That should read datasource subsystem...


--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

jtgreene
Administrator
On 8/15/11 3:02 PM, Jason T. Greene wrote:

> On 8/15/11 2:54 PM, Jason T. Greene wrote:
>> On 8/15/11 2:52 PM, Jason T. Greene wrote:
>>> On 8/15/11 2:30 PM, Jesper Pedersen wrote:
>>>> The admin console isn't done yet - use the command line client to see
>>>> the
>>>> functionality that is available today:
>>>
>>> It obviously can't flush a db pool if there isn't a management operation
>>> to do that.
>>
>> BTW to avoid misleading everyone I will say that the admin console
>> displays nearly everything (if not everything) the JCA subsystem
>> currently exposes.
>
> That should read datasource subsystem...

Correction the operation does exist:

flush-all-connections-in-pool and flush-idle-connections-in-pool

So it is just the console update that is needed. Sorry for the
misinformation.

--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to start/stop/reset connection pool by java program in AS7?

Bill Hong (Gong)
Thank you so much! I tried Command line client and saw all functionalities we needed were there. That's great.

I have another question for the piece of codes in management API document. How to get "domainController" instance in below codes?

EntityAddress address = EntityAddress.fromString("profile/web/subsystem/foobar");
MetaValue foo = createFooMetaValue();
MetaValue bar = createFooMetaValue();
domainController.invokeOnDomain("setFooBar", address, foo, bar);

Besides, I can't find which JBoss module implements the "EntityAddress" class. Is there a complete sample to demonstrate how to use management API to retrieve specific attribute or invoke an operation upon specific managed resource?

Thank you!

Regards,
Bill

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jason T. Greene
Sent: Tuesday, August 16, 2011 4:11 AM
To: Jesper Pedersen
Cc: [hidden email]
Subject: Re: [jboss-as7-dev] How to start/stop/reset connection pool by java program in AS7?

On 8/15/11 3:02 PM, Jason T. Greene wrote:

> On 8/15/11 2:54 PM, Jason T. Greene wrote:
>> On 8/15/11 2:52 PM, Jason T. Greene wrote:
>>> On 8/15/11 2:30 PM, Jesper Pedersen wrote:
>>>> The admin console isn't done yet - use the command line client to see
>>>> the
>>>> functionality that is available today:
>>>
>>> It obviously can't flush a db pool if there isn't a management operation
>>> to do that.
>>
>> BTW to avoid misleading everyone I will say that the admin console
>> displays nearly everything (if not everything) the JCA subsystem
>> currently exposes.
>
> That should read datasource subsystem...

Correction the operation does exist:

flush-all-connections-in-pool and flush-idle-connections-in-pool

So it is just the console update that is needed. Sorry for the
misinformation.

--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

CONFIDENTIALITY NOTICE
This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

AS7: the functionalities to retrieve runtime attributes for specific connection pool are missing

Bill Hong (Gong)
In reply to this post by Jesper Pedersen
Hi Jesper and Jason,

Thanks for the answers! They are very helpful for me to port related codes to AS7. However, I failed to get the values of runtime attributes for specific connection pool by using both Command line client and management API. I used "read-attribute" operation to retrieve runtime attribute, and it returned "undefined". Please see the below output:

[standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-resource(include-runtime=true)
{
    "outcome" => "success",
    "result" => {
        "ActiveCount" => undefined,
        "AvailableCount" => undefined,
        "AverageBlockingTime" => undefined,
        "AverageCreationTime" => undefined,
        "CreatedCount" => undefined,
        "DestroyedCount" => undefined,
        "MaxCreationTime" => undefined,
        "MaxUsedCount" => undefined,
        "MaxWaitCount" => undefined,
        "MaxWaitTime" => undefined,
        "PreparedStatementCacheAccessCount" => undefined,
        "PreparedStatementCacheAddCount" => undefined,
        "PreparedStatementCacheCurrentSize" => undefined,
        "PreparedStatementCacheDeleteCount" => undefined,
        "PreparedStatementCacheHitCount" => undefined,
        "PreparedStatementCacheMissCount" => undefined,
        "TimedOut" => undefined,
        "TotalBlockingTime" => undefined,
        "TotalCreationTime" => undefined,
        "background-validation" => undefined,
        "background-validation-minutes" => undefined,
        "blocking-timeout-wait-millis" => undefined,
        ...
    }
}
[standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-attribute(name=ActiveCount)
{
    "outcome" => "success",
    "result" => undefined
}

Would you please confirm if the function to retrieve runtime attribute is still not available yet?

Regards,
Bill

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jesper Pedersen
Sent: Tuesday, August 16, 2011 3:30 AM
To: [hidden email]
Subject: Re: [jboss-as7-dev] How to start/stop/reset connection pool by java program in AS7?

On Monday, August 15, 2011 07:27:24 AM Bill Hong (Gong) wrote:
> The functionalities to start/stop/reset a connection pool are not available
> in AS 7 "Admin Console" any more.

The admin console isn't done yet - use the command line client to see the
functionality that is available today:

 https://docs.jboss.org/author/display/AS7/Admin+Guide

> Besides, it seems the MBean service
> "jboss.jca.ManagedConnectionPool" is removed.

There are no MBean's for the managed connection pools in AS 7.

> Therefore, the previous
> approach in AS6 won't work now. I can't find any relevant documents to
> explain how to get the instance of "ManagedConnectionPool" in As7 and
> perform those actions in a java program. Can anyone give me some
> suggestions or clues to work it out please?

You need to use the management API to perform those operations.

Questions belong in the user forum:
http://community.jboss.org/en/jbossas/as7_users

Best regards,
 Jesper
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

CONFIDENTIALITY NOTICE
This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: AS7: the functionalities to retrieve runtime attributes for specific connection pool are missing

Stefano Maestri
Runtime attribute reading is not available yet.
We are working on it and it should be part of 7.1 for sure.

regards
S.

On 08/18/2011 09:07 AM, Bill Hong (Gong) wrote:

> Hi Jesper and Jason,
>
> Thanks for the answers! They are very helpful for me to port related codes to AS7. However, I failed to get the values of runtime attributes for specific connection pool by using both Command line client and management API. I used "read-attribute" operation to retrieve runtime attribute, and it returned "undefined". Please see the below output:
>
> [standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-resource(include-runtime=true)
> {
>      "outcome" =>  "success",
>      "result" =>  {
>          "ActiveCount" =>  undefined,
>          "AvailableCount" =>  undefined,
>          "AverageBlockingTime" =>  undefined,
>          "AverageCreationTime" =>  undefined,
>          "CreatedCount" =>  undefined,
>          "DestroyedCount" =>  undefined,
>          "MaxCreationTime" =>  undefined,
>          "MaxUsedCount" =>  undefined,
>          "MaxWaitCount" =>  undefined,
>          "MaxWaitTime" =>  undefined,
>          "PreparedStatementCacheAccessCount" =>  undefined,
>          "PreparedStatementCacheAddCount" =>  undefined,
>          "PreparedStatementCacheCurrentSize" =>  undefined,
>          "PreparedStatementCacheDeleteCount" =>  undefined,
>          "PreparedStatementCacheHitCount" =>  undefined,
>          "PreparedStatementCacheMissCount" =>  undefined,
>          "TimedOut" =>  undefined,
>          "TotalBlockingTime" =>  undefined,
>          "TotalCreationTime" =>  undefined,
>          "background-validation" =>  undefined,
>          "background-validation-minutes" =>  undefined,
>          "blocking-timeout-wait-millis" =>  undefined,
>          ...
>      }
> }
> [standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-attribute(name=ActiveCount)
> {
>      "outcome" =>  "success",
>      "result" =>  undefined
> }
>
> Would you please confirm if the function to retrieve runtime attribute is still not available yet?
>
> Regards,
> Bill
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Jesper Pedersen
> Sent: Tuesday, August 16, 2011 3:30 AM
> To: [hidden email]
> Subject: Re: [jboss-as7-dev] How to start/stop/reset connection pool by java program in AS7?
>
> On Monday, August 15, 2011 07:27:24 AM Bill Hong (Gong) wrote:
>> The functionalities to start/stop/reset a connection pool are not available
>> in AS 7 "Admin Console" any more.
> The admin console isn't done yet - use the command line client to see the
> functionality that is available today:
>
>   https://docs.jboss.org/author/display/AS7/Admin+Guide
>
>> Besides, it seems the MBean service
>> "jboss.jca.ManagedConnectionPool" is removed.
> There are no MBean's for the managed connection pools in AS 7.
>
>> Therefore, the previous
>> approach in AS6 won't work now. I can't find any relevant documents to
>> explain how to get the instance of "ManagedConnectionPool" in As7 and
>> perform those actions in a java program. Can anyone give me some
>> suggestions or clues to work it out please?
> You need to use the management API to perform those operations.
>
> Questions belong in the user forum:
> http://community.jboss.org/en/jbossas/as7_users
>
> Best regards,
>   Jesper
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
> CONFIDENTIALITY NOTICE
> This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: AS7: the functionalities to retrieve runtime attributes for specific connection pool are missing

Bill Hong (Gong)
That's great. In additional, a few operations for connection pool that are available in AS6 like start,stop,destroy are not available as well. Currently, "disable" operation will only be in-effect after restart server. I suppose enable/disable operations are different than start/stop in AS6. Hopefully, those operations will be available in AS7.1 as well.

Regards,
Bill

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Stefano Maestri
Sent: Thursday, August 18, 2011 9:01 PM
To: [hidden email]
Subject: Re: [jboss-as7-dev] AS7: the functionalities to retrieve runtime attributes for specific connection pool are missing

Runtime attribute reading is not available yet.
We are working on it and it should be part of 7.1 for sure.

regards
S.

On 08/18/2011 09:07 AM, Bill Hong (Gong) wrote:

> Hi Jesper and Jason,
>
> Thanks for the answers! They are very helpful for me to port related codes to AS7. However, I failed to get the values of runtime attributes for specific connection pool by using both Command line client and management API. I used "read-attribute" operation to retrieve runtime attribute, and it returned "undefined". Please see the below output:
>
> [standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-resource(include-runtime=true)
> {
>      "outcome" =>  "success",
>      "result" =>  {
>          "ActiveCount" =>  undefined,
>          "AvailableCount" =>  undefined,
>          "AverageBlockingTime" =>  undefined,
>          "AverageCreationTime" =>  undefined,
>          "CreatedCount" =>  undefined,
>          "DestroyedCount" =>  undefined,
>          "MaxCreationTime" =>  undefined,
>          "MaxUsedCount" =>  undefined,
>          "MaxWaitCount" =>  undefined,
>          "MaxWaitTime" =>  undefined,
>          "PreparedStatementCacheAccessCount" =>  undefined,
>          "PreparedStatementCacheAddCount" =>  undefined,
>          "PreparedStatementCacheCurrentSize" =>  undefined,
>          "PreparedStatementCacheDeleteCount" =>  undefined,
>          "PreparedStatementCacheHitCount" =>  undefined,
>          "PreparedStatementCacheMissCount" =>  undefined,
>          "TimedOut" =>  undefined,
>          "TotalBlockingTime" =>  undefined,
>          "TotalCreationTime" =>  undefined,
>          "background-validation" =>  undefined,
>          "background-validation-minutes" =>  undefined,
>          "blocking-timeout-wait-millis" =>  undefined,
>          ...
>      }
> }
> [standalone@localhost:9999 data-source=jdbc/njora206_stse3_medprom1se8] :read-attribute(name=ActiveCount)
> {
>      "outcome" =>  "success",
>      "result" =>  undefined
> }
>
> Would you please confirm if the function to retrieve runtime attribute is still not available yet?
>
> Regards,
> Bill
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Jesper Pedersen
> Sent: Tuesday, August 16, 2011 3:30 AM
> To: [hidden email]
> Subject: Re: [jboss-as7-dev] How to start/stop/reset connection pool by java program in AS7?
>
> On Monday, August 15, 2011 07:27:24 AM Bill Hong (Gong) wrote:
>> The functionalities to start/stop/reset a connection pool are not available
>> in AS 7 "Admin Console" any more.
> The admin console isn't done yet - use the command line client to see the
> functionality that is available today:
>
>   https://docs.jboss.org/author/display/AS7/Admin+Guide
>
>> Besides, it seems the MBean service
>> "jboss.jca.ManagedConnectionPool" is removed.
> There are no MBean's for the managed connection pools in AS 7.
>
>> Therefore, the previous
>> approach in AS6 won't work now. I can't find any relevant documents to
>> explain how to get the instance of "ManagedConnectionPool" in As7 and
>> perform those actions in a java program. Can anyone give me some
>> suggestions or clues to work it out please?
> You need to use the management API to perform those operations.
>
> Questions belong in the user forum:
> http://community.jboss.org/en/jbossas/as7_users
>
> Best regards,
>   Jesper
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
> CONFIDENTIALITY NOTICE
> This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

CONFIDENTIALITY NOTICE
This e-mail message from Delphi Technology, Inc. is intended only for the individual or entity to which it is addressed. This e-mail may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you received this e-mail by accident, please notify the sender immediately and destroy this e-mail and all copies of it.

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev