tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Openejb 3.0 : JUNIT with embedded Container can't commit Transaction
Date Thu, 05 Jun 2008 15:27:18 GMT
One addtitional information:

If code is run inside the Geronimo 2.1.1 App.server, the used 
Entitymanager is: org.apache.geronimo.persistence.CMPEntityManagerTxScoped
If junit runs in embedded openejb the Entitymanager is: 

Is there a way to change this for embedded openejb?


Hi All,

great Idea to do unit-testing using the embedded functions of openejb. So 
I tried... 

I have a JavaEE-5 application on Geronimo 2.1.1 with Postgres-DB. (Driver 
postgresql-8.2-508.jdbc3.jar). In Geronimo I defined a database pool with 
Pool-Type "TranQL XA Resource Adapter for PostgreSQL". I use Local Session 
Beans in General. The Application works quite well.

Thus I tried to do this with embedded openejb. After quite a few problems 
to set up the system, my JUNIT-Test works up to a certain step. It seems 
there is maybe an impact with the transaction - functionality. The 
transaction could not be comitted. I could imagine not the XA-Datasource 
is taken, but who knows??

  <SecurityService id="Default Security Service"/>
  <TransactionManager id="Default Transaction Manager"/> 

        public void setUp() throws Exception {
                Properties properties = new Properties();

                properties.put("Postgres.postgres.vesuv.UserName", "bla");
                properties.put("Postgres.postgres.vesuv.Password", "bla");

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="" 
xmlns:xsi="" xsi:schemaLocation="">
        <persistence-unit name="VesuvPU">
                <description>Vesuv Application</description>
                    <property name="openjpa.jdbc.SynchronizeMappings" 
value="false" />
                <property name="openjpa.jdbc.Schema" value="vesuv" />

Lookup of the SessionBean works. Invoking the method is fine. 
SQL-Statements are done. But 

[DEBUG] [BenutzerManagerImpl] >> Mandant: Mandant:Vesuv Servicestelle Id:1 
Kurzname: SS PersonFK:0 Tstaend:null
13:18:31,644 INFO  [Transaction] TX Required: Committing transaction 
13:18:31,693 DEBUG [SQL] <t 15431769, conn 0> executing prepstmnt 31310826 
UPDATE vesuv.v_org_einheit 
13:18:31,702 DEBUG [SQL] <t 15431769, conn 0> [9 ms] spent
13:18:31,717 DEBUG [SQL] <t 15431769, conn 0> executing prepstmnt 23410971 
UPDATE vesuv.benutzer SET 
Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> 
org.apache.openjpa.util.StoreException: FEHLER: kann eine Sicht nicht 
aktualisieren {prepstmnt 31310826 UPDATE vesuv.v_org_einheit SET 
beziehung_org_einheit_typ = ?, kurz_name = ?, name = ?, org_einheit_typ = 
?, person_fk = ?, rechtsform = ?, tstaend = ?, beziehung_org_einheit_fk = 
?, uebergeordnete_org_einheit_fk = ? WHERE id = ? [params=(null) null, 
(String) SS, (String) Vesuv Servicestelle, (String) SS, (long) 1, (String) 
SS, (Timestamp) 2008-05-26 10:10:43.96, (null) null, (null) null, (long) 
1]} [code=0, state=0A000]

The LOG-File is in German, therefore some translation: Sicht = View. The 
Update of the View-PAO does not work. Any suggestions ??? 

Thanx Josef
BGS Beratungsgesellschaft 
Software Systemplanung AG 
Niederlassung Rhein/Main 
Robert-Koch-Straße 41 
55129 Mainz 
Fon: +49 (0) 6131 / 914-0 
Fax: +49 (0) 6131 / 914-400 
Geschäftssitz Mainz 
Amtsgericht Mainz 
HRB 62 50 
Dr. Wolfgang Trommer 
Hanspeter Gau 
Hermann Kiefer 
Nils Manegold 
Heinz-Jörg Zimmermann 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message