Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Dali, Toplink (GlassFish) and DB2
Dali, Toplink (GlassFish) and DB2 [message #581903] Sat, 15 April 2006 17:02 Go to next message
Gunnar Wagenknecht is currently offline Gunnar Wagenknecht
Messages: 451
Registered: July 2009
Senior Member
Hi!

This topic is a little bit off-topic but I hope to get an answer from
the Dali/Toplink people here. ;)

I'm using Dali and generated some entities from existing tables. It's a
DB2 database. The problem is that I don't know how to set the DB2 schema
at runtime. When creating the connection in Eclipse Dali allowed to to
select a database schema (other than the default that belongs to the
user). However, I'm not aware of such an option in the persistence.xml
using GlassFish/Toplink.

The problem is probably because DB2 uses the user's schema as the
default schema. However the entity exists in a different schema on the
same db. Thus, a simple "select object(o) from Entity o" fails because
GlassFish is using the wrong schema.

I know that there is a property in Hibernate "hibernate.default_schema".
But I haven't found something similar in GlassFish.

Any ideas?

Thanks, Gunnar


--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: Dali, Toplink (GlassFish) and DB2 [message #716782 is a reply to message #581903] Thu, 18 August 2011 09:13 Go to previous messageGo to next message
Ali Manji is currently offline Ali Manji
Messages: 1
Registered: August 2011
Junior Member
Hi Gunnar - did you ever resolve this issue?
Re: Dali, Toplink (GlassFish) and DB2 [message #720056 is a reply to message #716782] Mon, 29 August 2011 14:43 Go to previous message
Neil Hauge is currently offline Neil Hauge
Messages: 469
Registered: July 2009
Senior Member
The standard JPA solution to setting a default schema for your persistence unit is to configure the schema setting in the persistence-unit-defaults. This is defined in 1 and only 1 XML Mapping file (orm.xml) as follows:

<entity-mappings ...>
<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>default_schema_name</schema>
</persistence-unit-defaults>
...
</entity-mappings>


Neil


Previous Topic:Using Dali annotation processor from a maven build
Next Topic:long & BigDecimal mappings in entities from tables
Goto Forum:
  


Current Time: Sat Aug 23 03:34:35 EDT 2014

Powered by FUDForum. Page generated in 0.01627 seconds