Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
179 lines (160 sloc) 6.04 KB
title review labels confluence tree_item_index version_override history
Transactions and Connections
comment date status
2017-12-13
ok
lts2016-ok
transaction
logs
bdelbosc
lts2017-ok
ajs-parent-page-id ajs-parent-page-title ajs-space-key ajs-space-name canonical canonical_source page_id shortlink shortlink_source source_link
950318
Monitoring and Maintenance
NXDOC
Nuxeo Platform Developer Documentation
Transactions+and+Connections
12288637
fYK7
/display/NXDOC/Transactions+and+Connections
700
LTS 2015 6.0 5.8
710/admindoc/transactions-and-connections
60/admindoc/transactions-and-connections
58/admindoc/transactions-and-connections
author date message version
Florent Guillaume
2015-12-09 13:12
20
author date message version
Solen Guitter
2014-09-05 10:30
typos
19
author date message version
Stéphane Lacoin
2014-09-03 11:32
18
author date message version
Stéphane Lacoin
2014-09-03 11:19
17
author date message version
Solen Guitter
2013-10-15 12:02
16
author date message version
Solen Guitter
2013-10-15 12:00
15
author date message version
Solen Guitter
2012-10-15 11:02
14
author date message version
Solen Guitter
2012-10-15 11:01
13
author date message version
Julien Carsique
2012-10-14 23:00
12
author date message version
Olivier Grisel
2012-10-14 16:26
11
author date message version
Olivier Grisel
2012-10-14 16:19
use JVisualVM as suggested JMX browser
10
author date message version
Olivier Grisel
2012-10-12 18:31
9
author date message version
Olivier Grisel
2012-10-12 18:30
8
author date message version
Thierry Delprat
2012-10-12 18:27
7
author date message version
Thierry Delprat
2012-10-12 18:27
6
author date message version
Stéphane Lacoin
2012-10-12 18:26
5
author date message version
Stéphane Lacoin
2012-10-12 18:24
4
author date message version
Stéphane Lacoin
2012-10-12 18:23
3
author date message version
Stéphane Lacoin
2012-10-12 18:22
2
author date message version
Stéphane Lacoin
2012-10-12 15:36
1

Troubleshooting issues with connections with transactional resources (databases) can be done with the help of the built-in nuxeo-core-management-jtajca  component.

Logging Transactional Events

Configure log4j in $NUXEO_HOME/lib/log4j.xml by adding the following keywords to your appender conversion pattern %t for the thread name and %X for the logging context map:

<param name="ConversionPattern" value="%d{ISO8601} %t %-5p [%c] %m %X%n" />

You should also add a new category if you want the traces to be enabled:

<category name="org.nuxeo.ecm.core.management.jtajca">
  <priority value="TRACE" />
</category>

At this stage, once a transaction is started or a connection is opened, their identifiers are put in a context map for the logger. By adding the %X keyword, you've requested to print them each a message is logged. The transactions and connections will also be logged. You should add additional log statements at level DEBUG or TRACE around the code you want to monitor.

Monitoring Transactional Resources

You should enable JMX to be able to poll the mbean attributes. To do this, in $NUXEO_HOME/bin/nuxeo.conf uncomment the JMX options as follows.

{{#> callout type='warning' }}

You should note that the these settings open a security hole on the server and should not be left as this in production, because they allow anyone to connect to the JMX server (unless additional firewall rules have been configured).

{{/callout}}

# Enable JMX
JAVA_OPTS=$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1089 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

The Nuxeo Platform contains JMX beans that will enable you to monitor the transactions and connections used in your system. Just point your JMX browser (such as JVisualVM using the VisualVM-MBeans Plugin which is part of the JDK) to the server and look for the following beans:

  • org.nuxeo.ecm.core.management.jtajca:type=ConnectionPoolMonitor,name=jdbc/nuxeo
  • org.nuxeo.ecm.core.management.jtajca:type=ConnectionPoolMonitor,name=repository/default
  • org.nuxeo.ecm.core.management.jtajca:type=CoreSessionMonitor,name=default
  • org.nuxeo.ecm.core.management.jtajca:type=TransactionMonitor,name=default

The ConnectionPoolMonitor provides you with a way to configure the pools connection size used by the Nuxeo storage (jdbc/nuxeo for the JDBC datasource pool, and repository/default for the VCS session pool). It also gives you access to global counters about the connection usage. It's enabled by default.

The TransactionMonitor provides useful information about the transactions in progress in your application. Also it gives you global counters and information about the last committed and rolled back transaction in the system. You should enable it by invoking the toggle operation.

 

You can’t perform that action at this time.