Using postgresql

Anonymous
2011-12-26
2013-02-07

  • Anonymous
    2011-12-26

    My MoquiProductionConf.xml:

    <?xml version="1.0" encoding="UTF-8" ?>
    <moqui-conf xmlns:xsi="[url]http://www.w3.org/2001/XMLSchema-instance[/url]" xsi:noNamespaceSchemaLocation="[url]http://moqui.org/xsd/moqui-conf-1.0.xsd[/url]">
        <server-stats>
            <artifact-stats type="screen" persist-bin="true" persist-hit="true"/>
            <artifact-stats type="screen-content" persist-bin="true" persist-hit="true"/>
            <artifact-stats type="transition" persist-bin="true" persist-hit="true"/>
            <artifact-stats type="service" persist-bin="true" persist-hit="false"/>
            <artifact-stats type="entity" persist-bin="false"/>
        </server-stats>
    
        <webapp-list>
            <webapp name="webroot" https-enabled="true">
                <root-screen host=".*" location="component://webroot/screen/webroot.xml"/>
            </webapp>
        </webapp-list>
    
        <screen-facade boundary-comments="false"/>
    
        <entity-facade> 
            <datasource group-name="transactional" database-conf-name="postgres" schema-name="public">
                <inline-jdbc pool-minsize="5" pool-maxsize="50">
                    <xa-properties user="moqui" password="moqui" serverName="localhost" portNumber="5432" databaseName="moquitransactional"/>
                </inline-jdbc>
            </datasource>
        </entity-facade>
    
        <repository-list>
            <repository name="main" location="[url]http://localhost:8081/server[/url]" type="davex" workspace="production"/>
        </repository-list>
    </moqui-conf>
    

    I added postgres jdbc driver jar to runtime/lib/

    Here's what I am getting when loading the data.

    XA resource 'DEFAULTtransactional': rollback for XID
    '3132372E302E302E312E746D30303030333030303133:3132372E302E302E312E746D31'
    raised -3: the XA resource detected an internal error

    org.postgresql.xa.PGXAException: Error rolling back prepared transaction

    at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:406)

    at com.atomikos.datasource.xa.XAResourceTransaction.rollback(XAResourceTransac
    tion.java:690)

    at com.atomikos.icatch.imp.RollbackMessage.send(RollbackMessage.java:72)

    at
    com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:111)

    at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)

    at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java
    :66)

    at com.atomikos.icatch.imp.CoordinatorStateHandler.rollback(CoordinatorStateHa
    ndler.java:746)

    at com.atomikos.icatch.imp.ActiveStateHandler.prepare(ActiveStateHandler.java:
    218)

    at com.atomikos.icatch.imp.CoordinatorImp.prepare(CoordinatorImp.java:832)

    at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:1159)

     
  • David E. Jones
    David E. Jones
    2011-12-26

    This looks like a known issue with Atomikos and Postgres. See:

    http://www.atomikos.com/Documentation/KnownProblems#Postgresql_Limited_XA_Sup
    port

    http://fogbugz.atomikos.com/default.asp?community.6.1503.6

    You could try using the jdbc-uri, etc attributes on the inline-jdbc element
    instead of using the xa-properties element. Doing that runs in a way that does
    not support distributed transactions fully, but should be fine otherwise. The
    Moqui Demo runs this way on Amazon ElasticBeanstalk with Amazon RDS
    (Relational Data Store or whatever it is) which is running MySQL (cheaper than
    Oracle on Amazon RDS).

        <datasource group-name="transactional" database-conf-name="mysql" schema-name="">
                <inline-jdbc jdbc-uri="jdbc:mysql://localhost:3306/transactional"
                             jdbc-username="moqui" jdbc-password="moqui"
                             pool-minsize="5" pool-maxsize="50"/>
        </datasource>
    
     

  • Anonymous
    2011-12-27

    Now I keep on getting something like:

    --- 11503279 [     Atomikos:1] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300012127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?                                                                                     
    --- 11513224 [     Atomikos:0] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300013127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?                                                                                     
    --- 11513280 [     Atomikos:1] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300012127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    
    --- 11523226 [     Atomikos:0] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300013127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?                                                                                     
    --- 11523282 [     Atomikos:1] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300012127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?                                                                                     
    --- 11523310 [     Atomikos:0] WARN                                  atomikos                                                                                                                                                     
     Local heuristic termination of coordinator 127.0.0.1.tm0000300013 with state HEUR_HAZARD
    
    --- 11523354 [     Atomikos:1] WARN                                  atomikos                                                                                                                                                     
     Local heuristic termination of coordinator 127.0.0.1.tm0000300012 with state HEUR_HAZARD                                                                                                                                         
    --- 11523462 [     Atomikos:0] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300013127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?                                                                                     
    --- 11523507 [     Atomikos:1] WARN                                  atomikos                                                                                                                                                     
     XAResourceTransaction 127.0.0.1.tm0000300012127.0.0.1.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    
     
  • David E. Jones
    David E. Jones
    2011-12-27

    Are those just warnings, or are things not functioning because of them?

    In general, I referred you to the resources for Atomikos because these issues
    are with Atomikos and Postgres and don't really have anything to do with Moqui
    Framework (other than that Moqui comes with Atomikos as the transaction
    manager by default).

    If you have too much trouble getting Atomikos to work with Postgres, you can
    try another database or another transaction manager. Moqui can be deployed in
    an app server with its own transaction and a DataSource/connection-pool
    management and use those from JNDI.

    Some things to consider anyway... Sorry I don't know of a more final solution.
    BTW, there are providers of support for both Atomikos and Postgres.

     

  • Anonymous
    2012-01-17

    A little bit late, but I stopped playing with moqui after I was hit with this
    issue. Basically those messages where scrolling for hours. I prefer to use
    another Transaction manager if possible. What is the process to replace the
    default "Atomikos" with another transaction manager. Is geromino tx a valid
    option ? Any open source replacements ?

     
  • David E. Jones
    David E. Jones
    2012-01-17

    As I mentioned above if you deploy in another app server you can configure
    Moqui to use the tx mgr and connection pool of the app server through JNDI.

    If you want to change the embedded tx mgr and conn pool you'll have to modify
    some code. The two main files are TransactionFacadeImpl.groovy and
    EntityFacadeImpl.groovy. They both have a bit of code for initializing
    implementations of the standard DataSource and
    UserTransaction/TransactionManager interfaces, so all you have to touch is the
    init and destroy code.

    As for other similar pieces of software, they certainly exist. Geronimo
    doesn't really have a separate tx mgr or conn pool and OFBiz actually uses a
    hacked approach for that, but you could do something similar to what OFBiz
    does to use embedded Geronimo (which is pretty messy code actually). You could
    also just deploy Moqui in Geronimo using its tools through JNDI.

     
  • David E. Jones
    David E. Jones
    2012-01-17

    I forgot to mention some other open source transaction managers, and BTW
    Atomikos is open source. Part of the reason I chose it was easy integration
    and the good paid support that is available.

    Anyway, aside from Atomikos:

    • JOTM (was dead for a while, but seems to be back at: http://jotm.ow2.org/)
    • JBossTM
    • Bitronix (part of codehaus)
     
  • Wei
    Wei
    2012-11-04

    I also got this error when i run "and load" with either msyql or posgresql. but i run it successfully for moqui 1.0

    [java] Apache Camel 2.9.2 (CamelContext: camel-1) is shutdown in 0.020 seconds
    [java] --- 23601 [ main] WARN tomikos.icatch.imp.TransactionServiceImp
    [java] Transaction Service: Waiting for non-terminated coordinators...
    [java] --- 33205 [ Atomikos:1] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000310.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 33210 [ Atomikos:0] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000410.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 43205 [ Atomikos:1] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000310.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 43210 [ Atomikos:0] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000410.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 53207 [ Atomikos:1] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000310.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 53211 [ Atomikos:0] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000410.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 53215 [ Atomikos:0] WARN com.atomikos.icatch.imp.CoordinatorImp
    [java] Local heuristic termination of coordinator 10.10.10.83.tm0000300004 with state HEUR_HAZARD
    [java] --- 53247 [ Atomikos:1] WARN com.atomikos.icatch.imp.CoordinatorImp
    [java] Local heuristic termination of coordinator 10.10.10.83.tm0000300003 with state HEUR_HAZARD
    [java] --- 53397 [ Atomikos:1] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000310.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 53421 [ Atomikos:0] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000410.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 63398 [ Atomikos:1] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000310.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?
    [java] --- 63423 [ Atomikos:0] WARN ikos.datasource.xa.XAResourceTransaction
    [java] XAResourceTransaction 10.10.10.83.tm000030000410.10.10.83.tm1: no XAResource to rollback - the required resource is probably not yet intialized?

    I am strange where 10.10.10.83 come from?

     
    Last edit: Wei 2012-11-04
  • David E. Jones
    David E. Jones
    2012-11-04

    Wei: what is the "error" and what isn't working? What you listed were warnings, and you can find out more about them from Atomikos. These log messages are generated from time to time and again are just warnings. If something isn't working then please describe the behavior.

    The 10.10.10.83 is probably the IP address of the machine it is running on (and it used as part of the transaction IDs).

     
  • Wei
    Wei
    2013-02-07

    I fixed this problem by using follwing jdbc configration:

    <entity-facade> 
        <datasource group-name="transactional" database-conf-name="postgres" schema-name="public">
            <inline-jdbc jdbc-uri="jdbc:postgresql://127.0.0.1/moquitransactional"
                         jdbc-username="postgres" jdbc-password="postgres"
                         pool-minsize="2" pool-maxsize="10"/>
        </datasource>
    </entity-facade>
    

    And change the values of max_prepared_transactions to same as max_connections in postgresql.conf

     
    Last edit: Wei 2013-02-07