Bug 779785 (SOA-2146) - HHH-3231 org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentException: alias not found: tbl" under Oracle
Summary: HHH-3231 org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentExce...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2146
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: EAP
Version: 4.3 CP05 CR1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: FUTURE
Assignee: trev
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-09 13:29 UTC by Samuel Mendenhall
Modified: 2011-12-05 18:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Hibernate 3.2.6GA, Oracle 10g
Last Closed: 2011-12-05 18:58:49 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2146 0 None Closed HHH-3231 org.hibernate.id.enhanced.TableGenerator throws "IllegalArgumentException: alias not found: tbl" under Oracle 2012-04-02 08:40:07 UTC

Description Samuel Mendenhall 2010-07-09 13:29:22 UTC
Affects: Release Notes
Help Desk Ticket Reference: https://access.redhat.com/issue-tracker/1110783
Workaround: Workaround Exists
Workaround Description: Use the enhanced sequence style generator to force Hibernate to use a table instead of a sequence. 
project_key: SOA

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}) );

Comment 1 Samuel Mendenhall 2010-07-09 13:30:07 UTC
Link: Added: This issue depends JBPAPP-4599


Comment 2 Rick Wagner 2011-12-05 18:58:49 UTC
Release Notes Text: Added: RE:JBPAPP-4599, issue was fixed in EAP 4.3.0.GA_CP09, brought into SOA4.3.0CP5.  So Closed.



Note You need to log in before you can comment on or make changes to this bug.