-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate with Teradata
PostPosted: Wed Oct 26, 2016 10:17 am 
Newbie

Joined: Wed Oct 26, 2016 9:51 am
Posts: 2
Hello.

I am attempting to interface my java application with Teradata. When I call org.hibernate.cfg.Configuration#buildSessionFactory, I get the following error:

ERROR: [Teradata Database] [TeraJDBC 15.10.00.05] [Error 5315] [SQLState HY000] The user does not have SELECT access to DBC.UDTInfo.TypeName

After doing some googling around, I found that the only solution that anyone ever mentions is that the user must have select access to DBC.UDTInfo.TypeName. But, supposing that I cannot get that access, is there a way around this problem?

The full stack trace is below.

Thanks!

Oct 26, 2016 9:57:05 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.3.Final}
Oct 26, 2016 9:57:05 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Oct 26, 2016 9:57:05 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Oct 26, 2016 9:57:05 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Oct 26, 2016 9:57:06 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
Oct 26, 2016 9:57:06 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001005: using driver [com.teradata.jdbc.TeraDriver] at URL [jdbc:teradata://<serveraddr>]
Oct 26, 2016 9:57:06 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001001: Connection properties: {user=****, password=****}
Oct 26, 2016 9:57:06 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH10001003: Autocommit mode: false
Oct 26, 2016 9:57:06 AM org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
Oct 26, 2016 9:57:08 AM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.TeradataDialect
Oct 26, 2016 9:57:09 AM org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
Oct 26, 2016 9:57:09 AM org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@e22bdd] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
Oct 26, 2016 9:57:10 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 5315, SQLState: HY000
Oct 26, 2016 9:57:10 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: [Teradata Database] [TeraJDBC 15.10.00.05] [Error 5315] [SQLState HY000] The user does not have SELECT access to DBC.UDTInfo.TypeName.
Oct 26, 2016 9:57:10 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
INFO: HHH10001008: Cleaning up connection pool [jdbc:teradata://<serveraddr>]
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Error accessing column metadata: <schemaname>.cr_test1
. . . at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
. . . at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
. . . at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:98)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.addColumns(InformationExtractorJdbcDatabaseMetaDataImpl.java:580)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.extractTableInformation(InformationExtractorJdbcDatabaseMetaDataImpl.java:206)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.processTableResults(InformationExtractorJdbcDatabaseMetaDataImpl.java:395)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getTables(InformationExtractorJdbcDatabaseMetaDataImpl.java:337)
. . . at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.getTablesInformation(DatabaseInformationImpl.java:120)
. . . at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:65)
. . . at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:203)
. . . at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:110)
. . . at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:177)
. . . at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:66)
. . . at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:309)
. . . at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:493)
. . . at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)
. . . at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
. . . at <mypackage>.StoreData.experiment00(StoreData.java:45)
. . . at <mypackage>.StoreData.main(StoreData.java:15)
Caused by: java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.05] [Error 5315] [SQLState HY000] The user does not have SELECT access to DBC.UDTInfo.TypeName.
. . . at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:308)
. . . at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:109)
. . . at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:307)
. . . at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:196)
. . . at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123)
. . . at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:114)
. . . at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:386)
. . . at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:328)
. . . at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:316)
. . . at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1105)
. . . at com.teradata.jdbc.TeraDatabaseMetaData.getColumns(TeraDatabaseMetaData.java:3297)
. . . at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.addColumns(InformationExtractorJdbcDatabaseMetaDataImpl.java:553)
. . . ... 15 more


Top
 Profile  
 
 Post subject: Re: Hibernate with Teradata
PostPosted: Thu Oct 27, 2016 12:25 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
From your stack trace, I see you're using the automatic schema generator

hibernate.hbm2ddl.auto

Try removing this configuration property and use a tool like Flyway instead.


Top
 Profile  
 
 Post subject: Re: Hibernate with Teradata
PostPosted: Fri Oct 28, 2016 10:49 am 
Newbie

Joined: Wed Oct 26, 2016 9:51 am
Posts: 2
Thanks, but unfortunately Flyway does not support Teradata at this time. I am now about to try Liquibase.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.