0 Replies Latest reply on Sep 6, 2013 11:03 AM by Manolo Beamer

    JBoss AS 7 standalone-ha cluster - ConstraintViolationException on flush

    Manolo Beamer Newbie

      Hello everyone,

       

      I have two JBoss AS 7.1 servers, running on Ubuntu Server 12.04 LTS. They are both using standalone-ha.xml configuration. The application is deployed to both of them successfully.

       

      The configuration (standalone-ha.xml) in both nodes (node1, node) is as follows:

       

      <?xml version='1.0' encoding='UTF-8'?>
      
      <server xmlns="urn:jboss:domain:1.2">
      
          <extensions>
              <extension module="org.jboss.as.clustering.infinispan"/>
              <extension module="org.jboss.as.clustering.jgroups"/>
              <extension module="org.jboss.as.configadmin"/>
              <extension module="org.jboss.as.connector"/>
              <extension module="org.jboss.as.deployment-scanner"/>
              <extension module="org.jboss.as.ee"/>
              <extension module="org.jboss.as.ejb3"/>
              <extension module="org.jboss.as.jaxrs"/>
              <extension module="org.jboss.as.jdr"/>
              <extension module="org.jboss.as.jmx"/>
              <extension module="org.jboss.as.jpa"/>
              <extension module="org.jboss.as.logging"/>
              <extension module="org.jboss.as.mail"/>
              <extension module="org.jboss.as.modcluster"/>
              <extension module="org.jboss.as.naming"/>
              <extension module="org.jboss.as.osgi"/>
              <extension module="org.jboss.as.pojo"/>
              <extension module="org.jboss.as.remoting"/>
              <extension module="org.jboss.as.sar"/>
              <extension module="org.jboss.as.security"/>
              <extension module="org.jboss.as.threads"/>
              <extension module="org.jboss.as.transactions"/>
              <extension module="org.jboss.as.web"/>
              <extension module="org.jboss.as.webservices"/>
              <extension module="org.jboss.as.weld"/>
          </extensions>
      
          <management>
              <security-realms>
                  <security-realm name="ManagementRealm">
                      <authentication>
                          <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
                      </authentication>
                  </security-realm>
                  <security-realm name="ApplicationRealm">
                      <authentication>
                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
                      </authentication>
                  </security-realm>
              </security-realms>
              <management-interfaces>
                  <native-interface security-realm="ManagementRealm">
                      <socket-binding native="management-native"/>
                  </native-interface>
                  <http-interface security-realm="ManagementRealm">
                      <socket-binding http="management-http"/>
                  </http-interface>
              </management-interfaces>
          </management>
      
          <profile>
              <subsystem xmlns="urn:jboss:domain:logging:1.1">
                  <console-handler name="CONSOLE">
                      <level name="INFO"/>
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                      </formatter>
                  </console-handler>
                  <periodic-rotating-file-handler name="FILE">
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="server.log"/>
                      <suffix value=".yyyy-MM-dd"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
                  <logger category="com.arjuna">
                      <level name="WARN"/>
                  </logger>
                  <logger category="org.apache.tomcat.util.modeler">
                      <level name="WARN"/>
                  </logger>
                  <logger category="sun.rmi">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb.config">
                      <level name="ERROR"/>
                  </logger>
                  <root-logger>
                      <level name="INFO"/>
                      <handlers>
                          <handler name="CONSOLE"/>
                          <handler name="FILE"/>
                      </handlers>
                  </root-logger>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
              <subsystem xmlns="urn:jboss:domain:datasources:1.0">
                  <datasources>
                      <datasource jta="true" jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="PostgresqlDS" enabled="true" use-java-context="true" use-ccm="true">
                          <connection-url>jdbc:postgresql://x1.x1.x1.x1:9999/operatus|jdbc:postgresql://x1.x1.x1.x1:9999/operatus</connection-url>
                          <driver>postgresql-jdbc4</driver>
                          <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                          <url-delimiter>|</url-delimiter>
                          <pool>
                              <min-pool-size>10</min-pool-size>
                              <max-pool-size>30</max-pool-size>
                              <prefill>true</prefill>
                          </pool>
                          <security>
                              <user-name>postgres</user-name>
                              <password>postgres</password>
                          </security>
                          <timeout>
                              <blocking-timeout-millis>60000</blocking-timeout-millis>
                              <idle-timeout-minutes>5</idle-timeout-minutes>
                          </timeout>
                          <statement>
                              <prepared-statement-cache-size>32</prepared-statement-cache-size>
                              <share-prepared-statements>true</share-prepared-statements>
                          </statement>
                      </datasource>
                      <drivers>
                          <driver name="postgresql-jdbc4" module="org.postgresql"/>
                      </drivers>
                  </datasources>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
                  <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
              <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
                  <session-bean>
                      <stateless>
                          <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                      </stateless>
                      <stateful default-access-timeout="5000" cache-ref="simple" clustered-cache-ref="clustered"/>
                      <singleton default-access-timeout="5000"/>
                  </session-bean>
                  <pools>
                      <bean-instance-pools>
                          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                      </bean-instance-pools>
                  </pools>
                  <caches>
                      <cache name="simple" aliases="NoPassivationCache"/>
                      <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
                      <cache name="clustered" passivation-store-ref="infinispan" aliases="StatefulTreeCache"/>
                  </caches>
                  <passivation-stores>
                      <file-passivation-store name="file"/>
                      <cluster-passivation-store name="infinispan" cache-container="ejb"/>
                  </passivation-stores>
                  <async thread-pool-name="default"/>
                  <timer-service thread-pool-name="default">
                      <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
                  </timer-service>
                  <remote connector-ref="remoting-connector" thread-pool-name="default"/>
                  <thread-pools>
                      <thread-pool name="default">
                          <max-threads count="10"/>
                          <keepalive-time time="100" unit="milliseconds"/>
                      </thread-pool>
                  </thread-pools>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="cluster">
                  <cache-container name="cluster" aliases="ha-partition" default-cache="default">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="default" mode="SYNC" batching="true">
                          <locking isolation="REPEATABLE_READ"/>
                      </replicated-cache>
                  </cache-container>
                  <cache-container name="web" aliases="standard-session-cache" default-cache="repl">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="repl" mode="ASYNC" batching="true">
                          <file-store/>
                      </replicated-cache>
                      <replicated-cache name="sso" mode="SYNC" batching="true"/>
                      <distributed-cache name="dist" mode="ASYNC" batching="true">
                          <file-store/>
                      </distributed-cache>
                  </cache-container>
                  <cache-container name="ejb" aliases="sfsb sfsb-cache" default-cache="repl">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="repl" mode="ASYNC" batching="true">
                          <eviction strategy="LRU"/>
                          <file-store/>
                      </replicated-cache>
                      <replicated-cache name="remote-connector-client-mappings" mode="SYNC" batching="true"/>
                      <distributed-cache name="dist" mode="ASYNC" batching="true">
                          <eviction strategy="LRU"/>
                          <file-store/>
                      </distributed-cache>
                  </cache-container>
                  <cache-container name="hibernate" default-cache="local-query">
                      <transport lock-timeout="60000"/>
                      <local-cache name="local-query">
                          <transaction mode="NONE"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <invalidation-cache name="entity" mode="SYNC">
                          <transaction mode="NON_XA"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </invalidation-cache>
                      <replicated-cache name="timestamps" mode="ASYNC">
                          <transaction mode="NONE"/>
                          <eviction strategy="NONE"/>
                      </replicated-cache>
                  </cache-container>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
              <subsystem xmlns="urn:jboss:domain:jca:1.1">
                  <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
                  <bean-validation enabled="true"/>
                  <default-workmanager>
                      <short-running-threads>
                          <core-threads count="50"/>
                          <queue-length count="50"/>
                          <max-threads count="50"/>
                          <keepalive-time time="10" unit="seconds"/>
                      </short-running-threads>
                      <long-running-threads>
                          <core-threads count="50"/>
                          <queue-length count="50"/>
                          <max-threads count="50"/>
                          <keepalive-time time="10" unit="seconds"/>
                      </long-running-threads>
                  </default-workmanager>
                  <cached-connection-manager/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
              <subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
                  <stack name="udp">
                      <transport type="UDP" socket-binding="jgroups-udp" diagnostics-socket-binding="jgroups-diagnostics"/>
                      <protocol type="PING"/>
                      <protocol type="MERGE2"/>
                      <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
                      <protocol type="FD"/>
                      <protocol type="VERIFY_SUSPECT"/>
                      <protocol type="BARRIER"/>
                      <protocol type="pbcast.NAKACK"/>
                      <protocol type="UNICAST2"/>
                      <protocol type="pbcast.STABLE"/>
                      <protocol type="pbcast.GMS"/>
                      <protocol type="UFC"/>
                      <protocol type="MFC"/>
                      <protocol type="FRAG2"/>
                  </stack>
                  <stack name="tcp">
                      <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
                      <protocol type="TCPPING">
                          <property name="initial_hosts">
                              x3.x3.x3.x3[7600],x4.x4.x4.x4[7600]
                          </property>
                          <property name="num_initial_members">
                              2
                          </property>
                          <property name="port_range">
                              0
                          </property>
                          <property name="timeout">
                              2000
                          </property>
                      </protocol>
                      <protocol type="MERGE2"/>
                      <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                      <protocol type="FD"/>
                      <protocol type="VERIFY_SUSPECT"/>
                      <protocol type="BARRIER"/>
                      <protocol type="pbcast.NAKACK"/>
                      <protocol type="UNICAST2"/>
                      <protocol type="pbcast.STABLE"/>
                      <protocol type="pbcast.GMS"/>
                      <protocol type="UFC"/>
                      <protocol type="MFC"/>
                      <protocol type="FRAG2"/>
                  </stack>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jmx:1.1">
                  <show-model value="true"/>
                  <remoting-connector/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jpa:1.0">
                  <jpa default-datasource=""/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:mail:1.0">
                  <mail-session jndi-name="java:jboss/mail/Default">
                      <smtp-server outbound-socket-binding-ref="mail-smtp"/>
                  </mail-session>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:modcluster:1.0">
                  <mod-cluster-config advertise-socket="modcluster">
                      <dynamic-load-provider>
                          <load-metric type="busyness"/>
                      </dynamic-load-provider>
                  </mod-cluster-config>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
              <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
                  <properties>
                      <property name="org.osgi.framework.startlevel.beginning">
                          1
                      </property>
                  </properties>
                  <capabilities>
                      <capability name="javax.servlet.api:v25"/>
                      <capability name="javax.transaction.api"/>
                      <capability name="org.apache.felix.log" startlevel="1"/>
                      <capability name="org.jboss.osgi.logging" startlevel="1"/>
                      <capability name="org.apache.felix.configadmin" startlevel="1"/>
                      <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
                  </capabilities>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
              <subsystem xmlns="urn:jboss:domain:remoting:1.1">
                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
              <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
              <subsystem xmlns="urn:jboss:domain:security:1.1">
                  <security-domains>
                      <security-domain name="other" cache-type="default">
                          <authentication>
                              <login-module code="Remoting" flag="optional">
                                  <module-option name="password-stacking" value="useFirstPass"/>
                              </login-module>
                              <login-module code="RealmUsersRoles" flag="required">
                                  <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
                                  <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
                                  <module-option name="realm" value="ApplicationRealm"/>
                                  <module-option name="password-stacking" value="useFirstPass"/>
                              </login-module>
                          </authentication>
                      </security-domain>
                      <security-domain name="jboss-web-policy" cache-type="default">
                          <authorization>
                              <policy-module code="Delegating" flag="required"/>
                          </authorization>
                      </security-domain>
                      <security-domain name="jboss-ejb-policy" cache-type="default">
                          <authorization>
                              <policy-module code="Delegating" flag="required"/>
                          </authorization>
                      </security-domain>
                  </security-domains>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
              <subsystem xmlns="urn:jboss:domain:transactions:1.1">
                  <core-environment>
                      <process-id>
                          <uuid/>
                      </process-id>
                  </core-environment>
                  <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
                  <coordinator-environment default-timeout="300"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
                  <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
                  <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
                  <virtual-server name="default-host" enable-welcome-root="true">
                      <alias name="localhost"/>
                      <alias name="example.com"/>
                  </virtual-server>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:webservices:1.1">
                  <modify-wsdl-address>true</modify-wsdl-address>
                  <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
                  <endpoint-config name="Standard-Endpoint-Config"/>
                  <endpoint-config name="Recording-Endpoint-Config">
                      <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                          <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                      </pre-handler-chain>
                  </endpoint-config>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
          </profile>
      
          <interfaces>
              <interface name="management">
                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
              </interface>
              <interface name="public">
                  <inet-address value="${jboss.bind.address:127.0.0.1}"/>
              </interface>
              <interface name="unsecure">
                  <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
              </interface>
          </interfaces>
      
          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
              <socket-binding name="management-http" interface="public" port="${jboss.management.http.port:9990}"/>
              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
              <socket-binding name="ajp" port="8009"/>
              <socket-binding name="http" port="8080"/>
              <socket-binding name="https" port="8443"/>
              <socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>
              <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
              <socket-binding name="jgroups-tcp" port="7600"/>
              <socket-binding name="jgroups-tcp-fd" port="57600"/>
              <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
              <socket-binding name="jgroups-udp-fd" port="54200"/>
              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
              <socket-binding name="osgi-http" interface="management" port="8090"/>
              <socket-binding name="remoting" port="4447"/>
              <socket-binding name="txn-recovery-environment" port="4712"/>
              <socket-binding name="txn-status-manager" port="4713"/>
              <outbound-socket-binding name="mail-smtp">
                  <remote-destination host="localhost" port="25"/>
              </outbound-socket-binding>
          </socket-binding-group>
      
      </server>
      

       

      Application looks like it has been correctly deployed on both nodes:

       

       

      06:34:15,449 INFO  [org.jboss.as.clustering.impl.CoreGroupCommunicationService.lifecycle.ejb] (Incoming-5,null) JBAS010247: New cluster view for partition ejb (id: 1, delta: 1, merge: true) : [node1/ejb, node2/ejb]
      06:34:15,467 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-5,null) ISPN000093: Received new, MERGED cluster view: MergeView::[node1/ejb|1] [node1/ejb, node2/ejb], subgroups=[node1/ejb|0] [node1/ejb], [node2/ejb|0] [node2/ejb]
      

       

      The application also works correctly for some time, but, especially when load increases, errors like these begin to occur:

       

      06:54:05,191 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (EJB default - 5) ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
      06:54:05,196 WARN  [com.arjuna.ats.arjuna] (EJB default - 5) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffff7f000101:63aa9a2c:52295b09:1cd, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@15beb534 >: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
          at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
          at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
          at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.tx.TimerCMTTxInterceptor.endTransaction(TimerCMTTxInterceptor.java:66) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.timerservice.task.CalendarTimerTask.callTimeout(CalendarTimerTask.java:60) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_03]
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_03]
          at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
          at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:128) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at $Proxy55.executeUpdate(Unknown Source)    at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:56) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2849) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3290) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:80) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:264) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:186) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          ... 33 more
      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
          at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
          at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
          at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:115)
          at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)
          at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) [:1.7.0_03]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          ... 47 more
      
      06:54:05,396 INFO  [org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl] (EJB default - 5) HHH000010: On release of batch it still contained JDBC statements
      06:54:05,399 ERROR [org.jboss.as.ejb3] (EJB default - 5) JBAS014120: Error invoking timeout for timer: [id=263ec5dd-7825-4510-9361-ac7b78debd44 timedObjectId=OperatusBL-1.0.OperatusEJB-1.0.CommunicationBean auto-timer?:true persistent?:false timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@6004688 initialExpiration=Fri Sep 06 00:00:00 CEST 2013 intervalDuration(in milli sec)=0 nextExpiration=Fri Sep 06 06:57:00 CEST 2013 timerState=IN_TIMEOUT: javax.ejb.EJBTransactionRolledbackException: Transaction rolled back
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleEndTransactionException(CMTTxInterceptor.java:115)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:95)
          at org.jboss.as.ejb3.tx.TimerCMTTxInterceptor.endTransaction(TimerCMTTxInterceptor.java:66)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
          at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101)
          at org.jboss.as.ejb3.timerservice.task.CalendarTimerTask.callTimeout(CalendarTimerTask.java:60)
          at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_03]
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_03]
          at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
          at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
      Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
          at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
          at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
          at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92)
          ... 24 more
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289)
          at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295)
          at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481)
          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109)
          at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)
          at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
          at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
          at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
          at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
          ... 27 more
      Caused by: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:128)
          at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
          at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)
          at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
          at $Proxy55.executeUpdate(Unknown Source)    at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:56)
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2849)
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3290)
          at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:80)
          at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272)
          at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:264)
          at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:186)
          at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)
          at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
          at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081)
          at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315)
          at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104)
          ... 33 more
      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "system_event_pkey"
        Szczegóły: Key (id_system_event)=(312619) already exists.
          at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
          at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
          at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:334)
          at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:115)
          at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)
          at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) [:1.7.0_03]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_03]
          at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_03]
          at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122)
          ... 47 more
      

       

      The database in question is postgresql, connected to by pgpool-3.2. system_event is a table in the database, one that is being written to perhaps most frequently. It looks like there is some kind of race condition when nodes try to perform batch updates. Is there anything wrong with this configuration?