How can i monitor in JPA

54 views
Skip to first unread message

chaojun zhang

unread,
Oct 25, 2013, 11:43:53 AM10/25/13
to java...@googlegroups.com
Hi 
   I'm using jpa in my project ,how can i make the jta datasource list below which reference in persistence.xml  can be monitored?

    I have persistence.xml :
   <?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="my-persistence-unit" transaction-type="JTA">

<jta-data-source>java:/exampleDS</jta-data-source>

    ......
</persistence>

   

Richard Richter

unread,
Oct 25, 2013, 11:52:56 AM10/25/13
to java...@googlegroups.com
Hi

There is nothing specific for JPA monitoring, but Datasource
monitoring is possible. You have to reconfigure your URL for
datasource (in ideal case) like you can read here:
http://code.google.com/p/javasimon/wiki/JavaEE

Be aware though, if you datasource is configured on application server
level, then you have to pull the Simon libs all the way up to server
libs!

Cheers

Virgo
> --
> You received this message because you are subscribed to the Google Groups
> "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to javasimon+...@googlegroups.com.
> To post to this group, send email to java...@googlegroups.com.
> Visit this group at http://groups.google.com/group/javasimon.
> For more options, visit https://groups.google.com/groups/opt_out.

chaojun zhang

unread,
Oct 28, 2013, 6:20:38 AM10/28/13
to java...@googlegroups.com
Ok, another question is  how can I disable the monitor as i don't want always log into file or stdout?

Richard Richter

unread,
Oct 28, 2013, 6:36:17 AM10/28/13
to java...@googlegroups.com
Hi

There are more ways how to do it, but they all get down to the call on
Manager. For instance - directly in code: SimonManager.disable();

Where to put this code is really up to you. Currently there is no out
of the box solution.

Virgo

chaojun zhang

unread,
Oct 29, 2013, 4:21:54 AM10/29/13
to java...@googlegroups.com
1)How can I to wrap a XA Datasource ,since the class WrappingSimonDataSource only used for wrap java.sql.Datasource but not the XaDatasource?

2)i use open source jdts as sql server driver , how can i to wrap this in application server (jboss as 7.1.1)

Richard Richter

unread,
Oct 29, 2013, 5:44:13 AM10/29/13
to java...@googlegroups.com
Well, you have to realize, that Simon is a lot "do it yourself"
solution and we can't even test everything we do... talking about this
package:
http://javasimon.googlecode.com/git-history/with-javadoc/api-3.4/org/javasimon/jdbcx4/package-summary.html

There is stuff for XA, but you're rather on your own, unless somebody
on the list has this particular experience.

I can't answer the second question at all.

Virgo

chaojun zhang

unread,
Oct 29, 2013, 7:50:55 AM10/29/13
to java...@googlegroups.com
For question 2:
   Because jtds driver seems can't set the url in the jboss standalone.xml,but the SimonConnectionConfiguration constructor required a  url as parameter .So is it possible to wrap JtdsDataSource  (XA Datasource) ?
  I have jtds xa-datasource configuration in my standalone.xml(you will see that no URL is required for jtds):

  <xa-datasource jta="true" jndi-name="java:/App-MSSQL" pool-name="mssqlPool" enabled="true" use-java-context="true" use-ccm="true">
<driver>JTDS</driver>
<xa-datasource-property name="ServerName">127.0.0.1
</xa-datasource-property>
<xa-datasource-property name="PortNumber">1433
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">xxxx
</xa-datasource-property>
<xa-datasource-property name="Instance">xxxx
</xa-datasource-property>
<security>
<security-domain>secdomain-ocelot</security-domain>
</security>
<xa-pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>40</max-pool-size>
<prefill>true</prefill>
</xa-pool>
<driver>JTDS</driver>
<validation>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
</validation>
</xa-datasource>

chaojun zhang

unread,
Oct 29, 2013, 8:09:55 AM10/29/13
to java...@googlegroups.com
Is it possible to use SimonXADatasource in the standaone.xml ?

chaojun zhang

unread,
Oct 29, 2013, 8:16:24 AM10/29/13
to java...@googlegroups.com
Because I don't want to wrap the datasource by programming in my java code, i just want to wrap the whole datasource in the jboss configuration file?

So is it possible to use SimonXADatasource in my configuration instead of real xa-datasource class specify in configuration file?


On Tuesday, October 29, 2013 5:44:13 PM UTC+8, Virgo47 wrote:
Reply all
Reply to author
Forward
0 new messages