-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Jboss AS 6.1.0 + JPA + Hibernate - Case Sensitive problem
PostPosted: Tue Sep 13, 2011 2:25 pm 
Newbie

Joined: Tue Sep 13, 2011 2:16 pm
Posts: 5
Good afternoon,
I am trying to migrate from Jboss AS version 5.1 to 6.1 and I am having this strange issue. I´ll aprecciate if someone help me.
I´ve this class:
Code:
@Entity
@Table(name = "TESTE_JBOSS")
public class Teste implements Serializable {
     ...
}


And I´ve the table TESTE_JBOSS in my database SQL SERVER 2008 R2 with collation Latin1_General_BIN. Note that both the table names are in uppercase.

When I put the server (JbossAS 6.1.0) up everything seems ok, but when I tried to use the application I got the error:
Quote:
...
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'teste_jboss'.
...



When I change the table name in database to lowercase things work, but I can´t change all the table and column names to lowercase.

I tried to change the persistence.xml, the version of hibernate to 3.6.7, the datasource, the jdbc driver. But anything worked.
I run this exactly same application in JbossAS 6.0 Final with hibernate to 3.6.7 and it worked fine. I don´t know if there is some configuration or if is a bug of JbossAS 6.1.0 + Hibernate.

I enabled the log and the stack trace before the error is

Quote:
13:47:04,605 INFO [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
13:47:04,609 INFO [org.hibernate.cfg.search.HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
13:47:04,613 INFO [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
13:47:04,614 INFO [org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:jdbc/DATASOURCE_TESTE
13:47:04,617 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.SQLServer2008Dialect
13:47:04,617 INFO [org.hibernate.cfg.SettingsFactory] Database ->
name : Microsoft SQL Server
version : 10.50.1617
major : 10
minor : 50
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Driver ->
name : Microsoft JDBC Driver 4.0 for SQL Server
version : 4.0.1427.2
major : 4
minor : 0
13:47:04,618 INFO [org.hibernate.transaction.TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
13:47:04,618 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Automatic flush during beforeCompletion(): disabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Automatic session close at end of transaction: disabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Scrollable result sets: enabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] JDBC3 getGeneratedKeys(): enabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Connection release mode: auto
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Default batch fetch size: 1
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Generate SQL with comments: disabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Order SQL updates by primary key: disabled
13:47:04,618 INFO [org.hibernate.cfg.SettingsFactory] Order SQL inserts for batching: disabled
13:47:04,619 INFO [org.hibernate.cfg.SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
13:47:04,619 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
13:47:04,619 INFO [org.hibernate.cfg.SettingsFactory] Query language substitutions: {}
13:47:04,620 INFO [org.hibernate.cfg.SettingsFactory] JPA-QL strict compliance: enabled
13:47:04,620 INFO [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled
13:47:04,620 INFO [org.hibernate.cfg.SettingsFactory] Query cache: disabled
13:47:04,620 INFO [org.hibernate.cfg.SettingsFactory] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: disabled
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Structured second-level cache entries: disabled
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Statistics: disabled
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Deleted entity synthetic identifier rollback: disabled
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Default entity-mode: pojo
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Named query checking : enabled
13:47:04,624 INFO [org.hibernate.cfg.SettingsFactory] Check Nullability in Core (should be disabled when Bean Validation is on): disabled
13:47:04,640 INFO [org.hibernate.impl.SessionFactoryImpl] building session factory
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@15dd9c
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [clob] overrides previous : org.hibernate.type.ClobType@1883817
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@1883817
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@1aaa49
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@a1c086
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@166d107
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@1253efb
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [blob] overrides previous : org.hibernate.type.BlobType@49f120
13:47:04,641 INFO [org.hibernate.type.BasicTypeRegistry] Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@49f120
13:47:04,692 INFO [org.hibernate.impl.SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
13:47:04,869 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 208, SQLState: S0002
13:47:04,869 ERROR [org.hibernate.util.JDBCExceptionReporter] Invalid object name 'teste_jboss'.


my persistence.xml looks like

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

          <persistence-unit name="testeUnit" transaction-type="RESOURCE_LOCAL">
                    <non-jta-data-source>java:jdbc/DATASOURCE_TESTE</non-jta-data-source>
                    <class>com.empresa.Teste</class>
                    <exclude-unlisted-classes>true</exclude-unlisted-classes>
                    <properties>
                              <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/>
                              <property name="hibernate.show_sql" value="true" />
                    </properties>
          </persistence-unit>
</persistence>



I started a discussion in jboss forum too: http://community.jboss.org/message/626268

Sorry about my english.

Someone have any idea?

Thks


Top
 Profile  
 
 Post subject: Re: Jboss AS 6.1.0 + JPA + Hibernate - Case Sensitive problem
PostPosted: Tue Nov 29, 2011 2:32 pm 
Newbie

Joined: Tue Sep 13, 2011 2:16 pm
Posts: 5
It seems to be a bug in versions after 3.6.7: https://hibernate.onjira.com/browse/HHH-6728

I changed the hibernate version to 3.6.0 and it worked.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.