I want to monitor JDBC connection and adapter.
I have observed even if oracle is down, the connection status is shown enabled in WmBrokerAdmin. We have to disable and enable it again to get the error response. I tried services in WmART to check if any service gives me the real time response but invain.
Can anyone suggest me how to get the real time response. I think we need to write a generic service to poll all the JDBC connections every unit of time.
i have configured JDBC connections for Oracle.
But it might be anyone of the supported DBs.
I had checked 2 functions in WmArt :
WmART/wm.art.admin.connection:setResourceState
WmART/wm.art.admin.connection:getResourceState
But the problem with them is when connections are enabled they will not reflect the status even if oracle goes down or jdbc package is disabled.
Only if you disable and try to enable them again the error response comes.
I will check the shareware utility and update you back.
I tried the shareware but its again using the same function setResourceState.
Using setResourceState can solve the problem but for monitoring is it recommended that we disable the connection and re-enable it. In production environment it will have an impact.
Sumit,
You are right on that demerit. The way I resolved it, is by a combination of ResetJDBCConnection and FindConnectionAsBroken Svc.
I have been using this set of services to monitor all my jdbc connections for past year.
Here is the brief gist of the solution: (I will upload a package if I find sufficient time to do so in the next week)
Step 1:
Create a Adpt Svc UniversalSelectStatement (for me, it goes like “select count(0) from systypes” - this works for Db2 and SQL Server. Check to see if it works for Oracle also or not. If you are only using Oracle, try a simpler statement as “select sysdate from dual”)
Step 2:
Create a Svc MonitorJDBCConnectionsHealth which iterates over all the adapter connections created (using listAllResources)
In this Svc, loop over all the connections to get the current state
if Enabled:
run the UniversalSelectStatement svc and see if any errors occur;
if errors occur, implies something wrong with the connection; set it to disabled state
if no errors, exit flow
if disabled:
try to set the connection to enabled state;
if error, retry after a time delay
if no error, PROBLEM SOLVED
Remember to be able to run the UniversalSelectStatement on different adapter connections, you would use the setAdapterServiceNodeConnection service.
Once completely developed, set MonitorJDBCConnectionsHealth on scheduler for 15 minutes.
Hope this clarifies the solution for you a little bit. Remember to test it extensively before putting any solution in production environment.
It would be great if you can upload the package at your leisure time.
Not clear a little bit on “Remember to be able to run the UniversalSelectStatement on different adapter connections, you would use the setAdapterServiceNodeConnection service”.
Remember to be able to run the UniversalSelectStatement on different adapter connections, you would use the setAdapterServiceNodeConnection service.
Explanation:
when you create any new adapter service, you associate it with a particular adapter connection. When you run that service, it runs for that pre-established connection at design time.
before v6.1, you were not allowed to change adapter connection associated with the adapter service.
after v6.1, you can use setAdapterServiceNodeConnection, to change the underlying adapter connection for any adapter service.
For Oracle : select count(0) from dual is working fine.
I want to make a generic service, i will have to check everytime for which DB the connection is made and then run the appropriate query.
Wondering! Have you guys found any better way to monitor the database connections (It’s alive or not) …
I have noticed an issue with one of the client where I am working now, the database connections lost (not restored) as a result (database was down and restarted etc)… Whatever, the reason… finally, Database become available and webMethods server still up and running… but, connection refused… Simple solution was disable and enable the connection…
What is the better(best) way to handle this issue… Please share your experience…
Set the minimumpool to “0” this avoids stale DB connections.
We followed the algorithm described above for monitoring (Although this has to be deloyed fully in real time)
Well, you may need to patch your IS with latest fix regarding the issue. This JDBC issue is quite a lot occured on system with a extremely high load.
Please check and download from webMethods Advantage.