This looks to me like a dreadful approach. Did you try including the
property in defaultPersistenceUnitProperties in the persistence
builder config
<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
<gbean name="PersistenceUnitBuilder"
class="org.apache.geronimo.persistence.builder.PersistenceUnitBuilder">
<attribute
name="defaultPersistenceProviderClassName">org.apache.openjpa.persistenc
e.PersistenceProviderImpl</attribute>
<attribute name="extendedEntityManagerRegistryName">?
name=ExtendedEntityManagerRegistry#org.apache.geronimo.persistence.Exten
dedEntityManagerRegistry</attribute>
<attribute name="defaultPersistenceUnitProperties">
openjpa.Log=commons
openjpa.ClassTransformerOptions=ScanDevPath=true
openjpa.jdbc.DBDictionary=org.apache.openjpa.jdbc.sql.DerbyDictionary
openjpa.jdbc.SynchronizeMappings=buildSchema
(ForeignKeys=true,SchemaAction='add,deleteTableContents')
openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)
</attribute>
<xml-attribute name="defaultEnvironment">
<environment xmlns="http://geronimo.apache.org/xml/ns/
deployment-1.1">
<dependencies>
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>openjpa</artifactId>
<type>car</type>
</dependency>
</dependencies>
</environment>
</xml-attribute>
</gbean>
?
thanks
david jencks
On Jun 28, 2007, at 9:12 AM, [EMAIL PROTECTED] wrote:
Author: kevan
Date: Thu Jun 28 09:12:32 2007
New Revision: 551608
URL: http://svn.apache.org/viewvc?view=rev&rev=551608
Log:
GERONIMO-3270 Avoid foreign key violations in CMP. Using operation-
order avoids the problem
Modified:
geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.bat
geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.sh
geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/
main/java/org/apache/geronimo/mavenplugins/geronimo/server/
StartServerMojo.java
Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-
minimal/src/main/resources/bin/geronimo.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/
geronimo-boilerplate-minimal/src/main/resources/bin/geronimo.bat?
view=diff&rev=551608&r1=551607&r2=551608
======================================================================
========
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.bat (original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.bat Thu Jun 28 09:12:32 2007
@@ -311,9 +311,10 @@
:doneSetArgs
@REM Setup the Java programming language agent
[EMAIL PROTECTED] For proper CMP behavior, we currently must specify operation-
order
set JAVA_AGENT_JAR=%GERONIMO_BASE%\bin\jpa.jar
set JAVA_AGENT_OPTS=
-if exist "%JAVA_AGENT_JAR%" set JAVA_AGENT_OPTS=-javaagent:"%
JAVA_AGENT_JAR%"
+if exist "%JAVA_AGENT_JAR%" set JAVA_AGENT_OPTS=-javaagent:"%
JAVA_AGENT_JAR%" -Dopenjpa.jdbc.UpdateManager=operation-order
@REM Execute Java with the applicable properties
if not "%JDB%" == "" goto doJDB
Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-
minimal/src/main/resources/bin/geronimo.sh
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/
geronimo-boilerplate-minimal/src/main/resources/bin/geronimo.sh?
view=diff&rev=551608&r1=551607&r2=551608
======================================================================
========
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.sh (original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/
src/main/resources/bin/geronimo.sh Thu Jun 28 09:12:32 2007
@@ -284,9 +284,10 @@
fi
# Setup the Java programming language agent
+# For proper CMP behavior, we currently must specify operation-order
JAVA_AGENT_JAR="$GERONIMO_BASE/bin/jpa.jar"
if [ -f "$JAVA_AGENT_JAR" ]; then
- JAVA_AGENT_OPTS="-javaagent:$JAVA_AGENT_JAR"
+ JAVA_AGENT_OPTS="-javaagent:$JAVA_AGENT_JAR -
Dopenjpa.jdbc.UpdateManager=operation-order"
else
JAVA_AGENT_OPTS=""
fi
Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/
src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/
StartServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-
plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/
mavenplugins/geronimo/server/StartServerMojo.java?
view=diff&rev=551608&r1=551607&r2=551608
======================================================================
========
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/
main/java/org/apache/geronimo/mavenplugins/geronimo/server/
StartServerMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/
main/java/org/apache/geronimo/mavenplugins/geronimo/server/
StartServerMojo.java Thu Jun 28 09:12:32 2007
@@ -187,9 +187,11 @@
}
// Load the Java programming language agent for JPA
+ // set operation-order is required for compliant behavior
from OpenJPA
File javaAgentJar = new File(geronimoHome, "bin/jpa.jar");
if (javaAgentJar.exists()) {
java.createJvmarg().setValue("-javaagent:" +
javaAgentJar.getCanonicalPath());
+ setSystemProperty(java, "openjpa.jdbc.UpdateManager",
"operation-order");
}
// Propagate some properties from Maven to the server if
enabled