[Hibernate-JIRA] Commented: (HHH-1651) hibernate does not find an existing sequence from an Oracle database
by Nick Stolwijk (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1651?page=c... ]
Nick Stolwijk commented on HHH-1651:
------------------------------------
We have the same problem here. We are not working with annotations but with hbm files and Spring configuration. We have found a workaround by disabling hbm2ddl validation.
> hibernate does not find an existing sequence from an Oracle database
> --------------------------------------------------------------------
>
> Key: HHH-1651
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1651
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.2.0 cr1
> Environment: Oracle 9i on Linux, Windows 2000, Hibernate-3.2, Hibernate-Annotations-3.1beta9
> Reporter: Olaf Bigalk
> Priority: Trivial
>
> Original Estimate: 2 hours
> Remaining: 2 hours
>
> I have setup a hibernate project with a few classes using id generation by the @Id @Generated annotation.
> The schema update fails due to the following error:
> ...
> 07.04.2006 15:12:07 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
> INFO: table not found: schema.hibernate_sequence
> 07.04.2006 15:12:07 org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
> INFO: table not found: hibernate_sequence
> 07.04.2006 15:12:08 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
> SCHWERWIEGEND: Unsuccessful: create sequence schema.hibernate_sequence
> 07.04.2006 15:12:08 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
> SCHWERWIEGEND: ORA-00955: name is already used by an existing object
> ...
> The error ocures because hibernate searches for existing sequences by the full qualified sequence name (i.e. "schema.hibernate_sequence") but it has retrieved the existing sequences from the database metadata with its unqualified names (i.e. "hibernate_sequence") . Hence it doess not find the existing sequence.
> Then it tries to create the pretended non existing sequence and fails.
> The relevant code ist found in org.hibernate.tool.hbm2ddl.DatabaseMetadata
> public boolean isSequence(Object key) {
> return key instanceof String && sequences.contains( ( (String) key ).toLowerCase() );
> }
> It should be somthing like this:
> public boolean isSequence(Object key) {
> if (key instanceof String) {
> String keyString = (String) key;
>
> if (sequences.contains( keyString.toLowerCase() ) {
> return true;
> }
> String [] strings = StringHelper.split(".", keyString);
> if(strings.length==3) {
> return sequences.contains( strings[2].toLowerCase();
> } else if (strings.length==2) {
> return sequences.contains( strings[1].toLowerCase();
> }
> }
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Updated: (HHH-1737) Add a ConnectionWrapper interface to allow access to the underlying connection from a BorrowedConnectionProxy
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737?page=all ]
Steve Ebersole updated HHH-1737:
--------------------------------
Summary: Add a ConnectionWrapper interface to allow access to the underlying connection from a BorrowedConnectionProxy (was: The new BorrowedConnectionProxy prevents users from accessing the native connection)
> Add a ConnectionWrapper interface to allow access to the underlying connection from a BorrowedConnectionProxy
> -------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1737
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.1, 3.1.2, 3.1.3
> Environment: Hibernate 3.1.3, Oracle 9.2.0.4
> Reporter: Nick Reid
> Assignee: Steve Ebersole
> Fix For: 3.2.1
>
>
> The borrowConnection functionality now prevents us from accessing the native connection to perform necessary operations (LOB handling, OAQ integration). Instead of just returning a simple proxy the implements java.sql.Connection the proxy could additionally implement an interface that allows users to access the wrapped connection returned by the ConnectionManager.
> i.e.
> public interface BorrowedConnection extends java.sql.Connection
> {
> java.sql.Connection getTargetConnection()
> }
> public class BorrowedConnectionProxy implements InvocationHandler {
> private final ConnectionManager connectionManager;
> private boolean useable = true;
> public BorrowedConnectionProxy(ConnectionManager connectionManager) {
> this.connectionManager = connectionManager;
> }
> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
> if ( "close".equals( method.getName() ) ) {
> connectionManager.releaseBorrowedConnection();
> return null;
> }
> if ( "getTargetConnection".equals( method.getName() ) ) {
> return connectionManager.getConnection();
> }
> // should probably no-op commit/rollback here, at least in JTA scenarios
> if ( !useable ) {
> throw new HibernateException( "connnection proxy not usable after transaction completion" );
> }
> try {
> return method.invoke( connectionManager.getConnection(), args );
> }
> catch( InvocationTargetException e ) {
> throw e.getTargetException();
> }
> }
> public static Connection generateProxy(ConnectionManager connectionManager) {
> BorrowedConnectionProxy handler = new BorrowedConnectionProxy( connectionManager );
> return ( Connection ) Proxy.newProxyInstance(
> Connection.class.getClassLoader(),
> new Class[] { BorrowedConnection.class },
> handler
> );
> }
> public static void renderUnuseable(Connection connection) {
> if ( connection != null && Proxy.isProxyClass( connection.getClass() ) ) {
> InvocationHandler handler = Proxy.getInvocationHandler( connection );
> if ( BorrowedConnectionProxy.class.isAssignableFrom( handler.getClass() ) ) {
> ( ( BorrowedConnectionProxy ) handler ).useable = false;
> }
> }
> }
> }
> We could always get access to the connectionManager field of the invocation handler via reflection, but this is not supportable or maintainable.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Assigned: (HHH-1737) The new BorrowedConnectionProxy prevents users from accessing the native connection
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737?page=all ]
Steve Ebersole reassigned HHH-1737:
-----------------------------------
Assign To: Steve Ebersole
> The new BorrowedConnectionProxy prevents users from accessing the native connection
> -----------------------------------------------------------------------------------
>
> Key: HHH-1737
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.1, 3.1.2, 3.1.3
> Environment: Hibernate 3.1.3, Oracle 9.2.0.4
> Reporter: Nick Reid
> Assignee: Steve Ebersole
> Fix For: 3.2.1
>
>
> The borrowConnection functionality now prevents us from accessing the native connection to perform necessary operations (LOB handling, OAQ integration). Instead of just returning a simple proxy the implements java.sql.Connection the proxy could additionally implement an interface that allows users to access the wrapped connection returned by the ConnectionManager.
> i.e.
> public interface BorrowedConnection extends java.sql.Connection
> {
> java.sql.Connection getTargetConnection()
> }
> public class BorrowedConnectionProxy implements InvocationHandler {
> private final ConnectionManager connectionManager;
> private boolean useable = true;
> public BorrowedConnectionProxy(ConnectionManager connectionManager) {
> this.connectionManager = connectionManager;
> }
> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
> if ( "close".equals( method.getName() ) ) {
> connectionManager.releaseBorrowedConnection();
> return null;
> }
> if ( "getTargetConnection".equals( method.getName() ) ) {
> return connectionManager.getConnection();
> }
> // should probably no-op commit/rollback here, at least in JTA scenarios
> if ( !useable ) {
> throw new HibernateException( "connnection proxy not usable after transaction completion" );
> }
> try {
> return method.invoke( connectionManager.getConnection(), args );
> }
> catch( InvocationTargetException e ) {
> throw e.getTargetException();
> }
> }
> public static Connection generateProxy(ConnectionManager connectionManager) {
> BorrowedConnectionProxy handler = new BorrowedConnectionProxy( connectionManager );
> return ( Connection ) Proxy.newProxyInstance(
> Connection.class.getClassLoader(),
> new Class[] { BorrowedConnection.class },
> handler
> );
> }
> public static void renderUnuseable(Connection connection) {
> if ( connection != null && Proxy.isProxyClass( connection.getClass() ) ) {
> InvocationHandler handler = Proxy.getInvocationHandler( connection );
> if ( BorrowedConnectionProxy.class.isAssignableFrom( handler.getClass() ) ) {
> ( ( BorrowedConnectionProxy ) handler ).useable = false;
> }
> }
> }
> }
> We could always get access to the connectionManager field of the invocation handler via reflection, but this is not supportable or maintainable.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Resolved: (HHH-1737) The new BorrowedConnectionProxy prevents users from accessing the native connection
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737?page=all ]
Steve Ebersole resolved HHH-1737:
---------------------------------
Fix Version: 3.2.1
Resolution: Fixed
trunk/3.2
> The new BorrowedConnectionProxy prevents users from accessing the native connection
> -----------------------------------------------------------------------------------
>
> Key: HHH-1737
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.1, 3.1.2, 3.1.3
> Environment: Hibernate 3.1.3, Oracle 9.2.0.4
> Reporter: Nick Reid
> Assignee: Steve Ebersole
> Fix For: 3.2.1
>
>
> The borrowConnection functionality now prevents us from accessing the native connection to perform necessary operations (LOB handling, OAQ integration). Instead of just returning a simple proxy the implements java.sql.Connection the proxy could additionally implement an interface that allows users to access the wrapped connection returned by the ConnectionManager.
> i.e.
> public interface BorrowedConnection extends java.sql.Connection
> {
> java.sql.Connection getTargetConnection()
> }
> public class BorrowedConnectionProxy implements InvocationHandler {
> private final ConnectionManager connectionManager;
> private boolean useable = true;
> public BorrowedConnectionProxy(ConnectionManager connectionManager) {
> this.connectionManager = connectionManager;
> }
> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
> if ( "close".equals( method.getName() ) ) {
> connectionManager.releaseBorrowedConnection();
> return null;
> }
> if ( "getTargetConnection".equals( method.getName() ) ) {
> return connectionManager.getConnection();
> }
> // should probably no-op commit/rollback here, at least in JTA scenarios
> if ( !useable ) {
> throw new HibernateException( "connnection proxy not usable after transaction completion" );
> }
> try {
> return method.invoke( connectionManager.getConnection(), args );
> }
> catch( InvocationTargetException e ) {
> throw e.getTargetException();
> }
> }
> public static Connection generateProxy(ConnectionManager connectionManager) {
> BorrowedConnectionProxy handler = new BorrowedConnectionProxy( connectionManager );
> return ( Connection ) Proxy.newProxyInstance(
> Connection.class.getClassLoader(),
> new Class[] { BorrowedConnection.class },
> handler
> );
> }
> public static void renderUnuseable(Connection connection) {
> if ( connection != null && Proxy.isProxyClass( connection.getClass() ) ) {
> InvocationHandler handler = Proxy.getInvocationHandler( connection );
> if ( BorrowedConnectionProxy.class.isAssignableFrom( handler.getClass() ) ) {
> ( ( BorrowedConnectionProxy ) handler ).useable = false;
> }
> }
> }
> }
> We could always get access to the connectionManager field of the invocation handler via reflection, but this is not supportable or maintainable.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Closed: (HHH-1629) SchemaUpdate/validator doesn't listen to quoting
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629?page=all ]
Max Rydahl Andersen closed HHH-1629:
------------------------------------
Fix Version: 3.2.1
Resolution: Fixed
it is also merged to trunk now. In any case, feedback on it working on "exotic" db/driver combos will be welcome!
> SchemaUpdate/validator doesn't listen to quoting
> ------------------------------------------------
>
> Key: HHH-1629
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629
> Project: Hibernate3
> Type: Bug
> Versions: 3.1.2
> Environment: Hibernate 3.1.2
> Postgres 8.0.4
> Linux
> Reporter: Nicklas Nordborg
> Priority: Trivial
> Fix For: 3.2.1
> Attachments: AffyFeatureData.hbm.xml, patch-HHH-1629.txt
>
>
> The SchemaUpdate only generates SQL with CREATE TABLE statements and can't update existing tables.
> With debugging turned on the SchemaUpdate reports:
> 11:25:22,599 INFO SchemaUpdate:114 - Running hbm2ddl schema update
> 11:25:22,599 INFO SchemaUpdate:126 - fetching database metadata
> .11:25:22,771 INFO SchemaUpdate:142 - updating schema
> 11:25:22,803 INFO DatabaseMetadata:91 - table not found: AffyFeatures
> 11:25:22,830 INFO DatabaseMetadata:91 - table not found: AnnotationSets
> 11:25:22,855 INFO DatabaseMetadata:91 - table not found: AnnotationTypeItems
> .... and so on for another 100+ tables
> All tables except two exists in the database. The two new tables are created successfully by SchemaUpdate.
> I attach one of my mapping files (generated by XDoclet).
> I had a quick look at the SchemaUpdate code (which calls DatabaseMetadata) and I think the problem is that it converts the table names to upper or lower case, even though I have quoted them in the mapping files. If the DatabaseMetadata.getTableMetadata could take a Table object as a parameter instead of the name, schema and catalog, it could check the Table.isQuoted() method before converting any names to upper or lower case. It seems like this method is only used by the Configuration class so it shouldn't be too hard to fix.
> I could do the fix myself, but I will only be able to validate it against Postgres and MySQL using quoted table names. So, others would probably have to validate it agains other databases and using unquoted table names.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Commented: (HHH-1737) The new BorrowedConnectionProxy prevents users from accessing the native connection
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737?page=c... ]
Steve Ebersole commented on HHH-1737:
-------------------------------------
The dialect approach will not work. This does not properly account for dealing with an Oracle connection from a datasource vs a connectionpool vs drivermanager.
The short term work around will be a new interface org.hibernate.jdbc.ConnectionWrapper, which defines exactly one method: Connection getWrappedConnection(). Two ways to use this:
(1) just call the new BorrowedConnectionProxy.getWrappedConnection method passing in the proxy
(2) cast the proxy to ConnectionWrapper, and call getWrappedConnection().
Eventually I'll add a way to use the real connection in a scoped manner which will be the preferred approach.
> The new BorrowedConnectionProxy prevents users from accessing the native connection
> -----------------------------------------------------------------------------------
>
> Key: HHH-1737
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1737
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.1, 3.1.2, 3.1.3
> Environment: Hibernate 3.1.3, Oracle 9.2.0.4
> Reporter: Nick Reid
>
>
> The borrowConnection functionality now prevents us from accessing the native connection to perform necessary operations (LOB handling, OAQ integration). Instead of just returning a simple proxy the implements java.sql.Connection the proxy could additionally implement an interface that allows users to access the wrapped connection returned by the ConnectionManager.
> i.e.
> public interface BorrowedConnection extends java.sql.Connection
> {
> java.sql.Connection getTargetConnection()
> }
> public class BorrowedConnectionProxy implements InvocationHandler {
> private final ConnectionManager connectionManager;
> private boolean useable = true;
> public BorrowedConnectionProxy(ConnectionManager connectionManager) {
> this.connectionManager = connectionManager;
> }
> public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
> if ( "close".equals( method.getName() ) ) {
> connectionManager.releaseBorrowedConnection();
> return null;
> }
> if ( "getTargetConnection".equals( method.getName() ) ) {
> return connectionManager.getConnection();
> }
> // should probably no-op commit/rollback here, at least in JTA scenarios
> if ( !useable ) {
> throw new HibernateException( "connnection proxy not usable after transaction completion" );
> }
> try {
> return method.invoke( connectionManager.getConnection(), args );
> }
> catch( InvocationTargetException e ) {
> throw e.getTargetException();
> }
> }
> public static Connection generateProxy(ConnectionManager connectionManager) {
> BorrowedConnectionProxy handler = new BorrowedConnectionProxy( connectionManager );
> return ( Connection ) Proxy.newProxyInstance(
> Connection.class.getClassLoader(),
> new Class[] { BorrowedConnection.class },
> handler
> );
> }
> public static void renderUnuseable(Connection connection) {
> if ( connection != null && Proxy.isProxyClass( connection.getClass() ) ) {
> InvocationHandler handler = Proxy.getInvocationHandler( connection );
> if ( BorrowedConnectionProxy.class.isAssignableFrom( handler.getClass() ) ) {
> ( ( BorrowedConnectionProxy ) handler ).useable = false;
> }
> }
> }
> }
> We could always get access to the connectionManager field of the invocation handler via reflection, but this is not supportable or maintainable.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Commented: (HHH-672) bug in ComponentType isModified method ClassCastException (dom4j)
by David Morton (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-672?page=co... ]
David Morton commented on HHH-672:
----------------------------------
This error occurs for me when the parent entity (class) has SelectBeforeUpdate="true". The error occurs in the many-to-one association based on a composite key. If SelectBeforeUpdate="false" I don't get the same behaviour.
> bug in ComponentType isModified method ClassCastException (dom4j)
> -----------------------------------------------------------------
>
> Key: HHH-672
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-672
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1 rc3
> Environment: Hibernate 3.1 (stream), oracle 9.02
> Reporter: Jessica Marchiori
>
>
> There is a bug with the EntityMode.DOM4j in class ComponentType method isModified. The association of oldValues causes a ClassCastException
> The original code was
> public boolean isModified(Object old, Object current, SessionImplementor session)
> throws HibernateException {
> if ( current == null ) return old != null;
> if ( old == null ) return current != null;
> Object[] currentValues = getPropertyValues( current, session );
> Object[] oldValues = ( Object[] ) old;
> }
>
> for ( int i = 0; i < currentValues.length; i++ ) {
> if ( propertyTypes[i].isModified( oldValues[i], currentValues[i], session ) ) {
> return true;
> }
> }
> return false;
> }
> I have changed the code as below
> public boolean isModified(Object old, Object current, SessionImplementor session)
> throws HibernateException {
> if ( current == null ) return old != null;
> if ( old == null ) return current != null;
> Object[] currentValues = getPropertyValues( current, session );
> Object[] oldValues = getPropertyValues( old, session );
>
> for ( int i = 0; i < currentValues.length; i++ ) {
> if ( propertyTypes[i].isModified( oldValues[i], currentValues[i], session ) ) {
> return true;
> }
> }
> return false;
> }
> and it works
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Commented: (HHH-1629) SchemaUpdate/validator doesn't listen to quoting
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629?page=c... ]
Max Rydahl Andersen commented on HHH-1629:
------------------------------------------
I've applied a fix for this (similar to the patch, but different).
We really need fast feedback from you guys if it solves your issue since varies between drivers and dbs - please checkout Branch_3_2 and let us know ASAP.
> SchemaUpdate/validator doesn't listen to quoting
> ------------------------------------------------
>
> Key: HHH-1629
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629
> Project: Hibernate3
> Type: Bug
> Versions: 3.1.2
> Environment: Hibernate 3.1.2
> Postgres 8.0.4
> Linux
> Reporter: Nicklas Nordborg
> Priority: Trivial
> Attachments: AffyFeatureData.hbm.xml, patch-HHH-1629.txt
>
>
> The SchemaUpdate only generates SQL with CREATE TABLE statements and can't update existing tables.
> With debugging turned on the SchemaUpdate reports:
> 11:25:22,599 INFO SchemaUpdate:114 - Running hbm2ddl schema update
> 11:25:22,599 INFO SchemaUpdate:126 - fetching database metadata
> .11:25:22,771 INFO SchemaUpdate:142 - updating schema
> 11:25:22,803 INFO DatabaseMetadata:91 - table not found: AffyFeatures
> 11:25:22,830 INFO DatabaseMetadata:91 - table not found: AnnotationSets
> 11:25:22,855 INFO DatabaseMetadata:91 - table not found: AnnotationTypeItems
> .... and so on for another 100+ tables
> All tables except two exists in the database. The two new tables are created successfully by SchemaUpdate.
> I attach one of my mapping files (generated by XDoclet).
> I had a quick look at the SchemaUpdate code (which calls DatabaseMetadata) and I think the problem is that it converts the table names to upper or lower case, even though I have quoted them in the mapping files. If the DatabaseMetadata.getTableMetadata could take a Table object as a parameter instead of the name, schema and catalog, it could check the Table.isQuoted() method before converting any names to upper or lower case. It seems like this method is only used by the Configuration class so it shouldn't be too hard to fix.
> I could do the fix myself, but I will only be able to validate it against Postgres and MySQL using quoted table names. So, others would probably have to validate it agains other databases and using unquoted table names.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months
[Hibernate-JIRA] Updated: (HHH-1629) SchemaUpdate/validator doesn't listen to quoting
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629?page=all ]
Max Rydahl Andersen updated HHH-1629:
-------------------------------------
Summary: SchemaUpdate/validator doesn't listen to quoting (was: SchemaUpdate doesn't work with Postgres)
> SchemaUpdate/validator doesn't listen to quoting
> ------------------------------------------------
>
> Key: HHH-1629
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629
> Project: Hibernate3
> Type: Bug
> Versions: 3.1.2
> Environment: Hibernate 3.1.2
> Postgres 8.0.4
> Linux
> Reporter: Nicklas Nordborg
> Priority: Trivial
> Attachments: AffyFeatureData.hbm.xml, patch-HHH-1629.txt
>
>
> The SchemaUpdate only generates SQL with CREATE TABLE statements and can't update existing tables.
> With debugging turned on the SchemaUpdate reports:
> 11:25:22,599 INFO SchemaUpdate:114 - Running hbm2ddl schema update
> 11:25:22,599 INFO SchemaUpdate:126 - fetching database metadata
> .11:25:22,771 INFO SchemaUpdate:142 - updating schema
> 11:25:22,803 INFO DatabaseMetadata:91 - table not found: AffyFeatures
> 11:25:22,830 INFO DatabaseMetadata:91 - table not found: AnnotationSets
> 11:25:22,855 INFO DatabaseMetadata:91 - table not found: AnnotationTypeItems
> .... and so on for another 100+ tables
> All tables except two exists in the database. The two new tables are created successfully by SchemaUpdate.
> I attach one of my mapping files (generated by XDoclet).
> I had a quick look at the SchemaUpdate code (which calls DatabaseMetadata) and I think the problem is that it converts the table names to upper or lower case, even though I have quoted them in the mapping files. If the DatabaseMetadata.getTableMetadata could take a Table object as a parameter instead of the name, schema and catalog, it could check the Table.isQuoted() method before converting any names to upper or lower case. It seems like this method is only used by the Configuration class so it shouldn't be too hard to fix.
> I could do the fix myself, but I will only be able to validate it against Postgres and MySQL using quoted table names. So, others would probably have to validate it agains other databases and using unquoted table names.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 2 months