Keith, You can specify a default schema in a DB2 connection URL like this:
jdbc:db2://mserver:50007/MYDB7T:currentSchema=MySchema; Can you use this syntax when creating the data source? Regards, Milosz > > I am using OpenJPA 1.2.3 on WebSphere with DB2. > > I have spent a lot of time trying to figure out if there is a way to build > and bundle my application in a way that allows for the same application > (EAR) to have a changing Schema name based on environment (DEV,ACPT,PROD, > etc). > > My PU is setup up to be container managed as follows: > > <persistence> > <persistence-unit name="My_PU" transaction-type="JTA"> > <jta-data-source>jdbc/DataSource</jta-data-source> > ... > <properties> > <property name="openjpa.jdbc.Schema" value="MYSCHEMA"/> > <property name="openjpa.TransactionMode" > value="managed"/> > <property name="openjpa.ConnectionFactoryMode" > value="managed"/> > </properties> > </persistence-unit> > </persistence> > > I have looked into putting this in the ORM.xml, but this is still a static > value for the schema, and does not externalize the setting; also, it doesn't > seem to work (I have seen the many threads discussing this). I also, have > looked into putting this configuration into the WebSphere data source; this > does not seem to work either. > > Any help is appreciated. Thanks. > > --Keith >