-
1. Re: forcing specific type mapping/dialect for datasource
nickarls Aug 28, 2012 5:27 AM (in response to mclu)A property in persistence.xml sounds like it would do the job.
-
2. Re: forcing specific type mapping/dialect for datasource
mclu Aug 28, 2012 5:45 AM (in response to nickarls)Thx Nicklas!
Problem is that we have a product where we support various databases. We have multiple persistence.xml files in multiple jars inside the ear.
While installing our product we don't want to change or alter our packed ear. Only the jboss configuration was changed in the past by our installer.....
So if there is a "global" way to force it plz let me know.
Markus
-
3. Re: forcing specific type mapping/dialect for datasource
nickarls Aug 28, 2012 6:00 AM (in response to mclu)Don't recall seeing type-mapping for datasources on AS7 (somebody else probably knows more). We build with maven so for our similar case we just have different profiles that filter the xml files...
-
4. Re: forcing specific type mapping/dialect for datasource
mclu Aug 28, 2012 6:05 AM (in response to mclu)By the way... The setMaxResult() issue is solved. It was not the mapping.
If you set this to Integer.MAX_VALUE because the user has no upper limit I got this exception:
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Invalid parameter index 2.
It seams that there is an overflow. Maybe related to https://hibernate.onjira.com/browse/HHH-5699
If i simply substract some numbers like Integer.MAX_VALUE-1000 then it works.
Just if someone has the same issue and this thread is a google hit :-)
Greets
-
5. Re: forcing specific type mapping/dialect for datasource
ctomc Aug 28, 2012 8:38 AM (in response to mclu)Hi,
type-mapping that used to be part of -ds.xml was only used for CMP persistence which you do not use.
Best and proper solution is what Niclas suggested, that is to set hibernate.dialect in persistence.xml / hibernate.cfg.xml
If you are using persistence.xml you can use system propery resolving inside them with syntax ${name.of.property} in that case you could define system properties for server and you would not need to modify the deployment for different server.
You are talking about sql server 2010? are you sure, you probably mean 2008r2 or 2012 that just came out.
when you will have dialect properly set, probably your issue will go away.
--
tomaz
-
6. Re: forcing specific type mapping/dialect for datasource
nickarls Aug 28, 2012 1:57 PM (in response to ctomc)Cool, never though about the ${}-expansion, does it work automagically in all the xml files in a deployment or just some?
-
7. Re: forcing specific type mapping/dialect for datasource
mclu Aug 30, 2012 3:30 AM (in response to ctomc)Yepp Thomaz...
My mistake... its 2012 not 2010
and there is already a jira for this issue : https://hibernate.onjira.com/browse/HHH-7522
And thx for the property idea... mabe this could be a solution!
-
8. Re: forcing specific type mapping/dialect for datasource
ctomc Aug 30, 2012 9:03 AM (in response to nickarls)Nicklas,
it was added around 7.1.1/7.1.2 i am not sure anymore when exactly.
but basicly you can control what can be replaced in ee subsystem
basicly it can be replaced in all descriptors, by default in jboss descriptors, for spec defined descriptors you have to enable them...
ee subystem config is quite self explinatory abou this
<subsystem xmlns="urn:jboss:domain:ee:1.1">
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
</subsystem>
--
tomaz