[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3231) org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentException: alias not found: tbl" under Oracle

Prakash (JIRA) noreply at atlassian.com
Mon Sep 29 13:50:04 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31301#action_31301 ] 

Prakash commented on HHH-3231:
------------------------------

I am still having the same problem with latest build 3.3.1. We are trying to implement TableGenerator for SQL Server and Oracle both. The configuration works well for SQL Server, but not for Oracle. Is this issue really fixed?


Exception in thread "main" org.hibernate.MappingException: could not instantiate id generator
        at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:98)
        at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:192)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
        at managers.HibernateManager.createSessionFactory(HibernateManager.java:42)
        at hibernate.checkHibernate.<init>(checkHibernate.java:35)
        at hibernate.Main.startHibernate(Main.java:80)
        at hibernate.Main.main(Main.java:61)
Caused by: java.lang.IllegalArgumentException: alias not found: tbl
        at org.hibernate.sql.ForUpdateFragment.<init>(ForUpdateFragment.java:36)
        at org.hibernate.dialect.Dialect.applyLocksToSql(Dialect.java:970)
        at org.hibernate.id.enhanced.TableGenerator.configure(TableGenerator.java:194)
        at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:94)
        ... 7 more
Java Result: 1


> org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentException: alias not found: tbl" under Oracle
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-3231
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3231
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Hibernate 3.2.6GA, Oracle 10g
>            Reporter: Király Attila
>            Assignee: Steve Ebersole
>             Fix For: 3.2.x, 3.3.1, 3.4
>
>         Attachments: hibernate_etg_ora.zip
>
>
> org.hibernate.id.enhanced.TableGenerator always throws the following exception if I want to save a new object to Oracle:
> java.lang.IllegalArgumentException: alias not found: tbl
> 	at org.hibernate.sql.ForUpdateFragment.<init>(ForUpdateFragment.java:36)
> 	at org.hibernate.dialect.Dialect.applyLocksToSql(Dialect.java:970)
> 	at org.hibernate.id.enhanced.TableGenerator.configure(TableGenerator.java:194)
> 	at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:104)
> I attach an example to this case. The example is loosely based on the tutorial example, that comes with Hibernate. It contains a Person object that is saved to db using the enhanced.TableGenerator as id generator. To keep the zip small only the jars of jdbc driver are included, the jars needed from hibernate distribution are listed in lib/readme.txt.
> The zip also contains a modified TableGenerator that works with Oracle. This version was made by forum user stomp and more information about it can be read here: http://forum.hibernate.org/viewtopic.php?t=980933
> It changes the 194th row of TableGenerator from
> this.query = dialect.applyLocksToSql( query, lockMap, CollectionHelper.EMPTY_MAP );
> to
> this.query = dialect.applyLocksToSql( query, lockMap, Collections.singletonMap("tbl", new String[] {valueColumnName}) );

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the hibernate-issues mailing list