No - i mean that the unit tests in hibernate (under the test directory and run by doing "build junit" or run
AllTest.java from inside your favorite IDE).
These test will stress/functional test your dialect and db.
-max
Max, As I understand you mean that every method and newly added code must be used by the tests at least once. Correct ?! Sorry I have no experience with production testing, so I have to ask such questions :( Thanks, Sergey
________________________________
From: Max Andersen [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 11:24 AM To: Sergey Menis; hibernate-devel@lists.sourceforge.net Subject: SV: [Hibernate] Index creation on PK (Hibernate3, Gupta SQL Base)
Yes - all the unit tests. -max
________________________________
Fra: Sergey Menis [mailto:[EMAIL PROTECTED] Sendt: to 03-02-2005 17:21 Til: Max Andersen; hibernate-devel@lists.sourceforge.net Emne: RE: [Hibernate] Index creation on PK (Hibernate3, Gupta SQL Base)
Max,
Thank you for your reply. It seems I am the only one, messing with SQLBase :) I have partially completed the SQLBaseDialect and patched the Configuration in addition to Dialect class. This works for my cases so far, yet I have to tested it properly. Once I have something "pretty" I will submit a patch to CVS. Are there any predefined test procedures you have developed for the Dialects?
Thank you,
Sergey Menis
-----Original Message----- From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 7:12 AM To: Sergey Menis; hibernate-devel@lists.sourceforge.net Subject: Re: [Hibernate] Index creation on PK (Hibernate3, Gupta SQL Base)
On Mon, 24 Jan 2005 14:42:38 -0500, Sergey Menis <[EMAIL PROTECTED]> wrote:
I didn't notice if you got an answer to this yet - so just ignore me if otherwise ;)
You are correct about your need to extend configuration/dialect.
You probably also need to look at Table.primaryKey and see where it is used when creating primary keys.
I also *think* HSQLDialect has the same issues and that it is not handled in a good way at the moment (some instanceof HSQLDialect somewhere).
Thus you should add something like "requireAlterTableForPrimaryKey()" or something to Dialect to handle it more smoothly.
/max
All,
I am in the process of creating a dialect to communicate with Gupta SQLbase database. Currently I am facing a problem of "Table in incomplete state". According to Gupta this problem is caused by a missing index on the primary key. This appears to be correct since there are no indexes created on my table (NOTATION), once the SchemaExport runs. I have tested the same mapping documents and identical code on MSSQL Server, using the provided dialect (SQLServerDialect) and there are no problems with index creation. This
explicitly. Hence my question:is due to the fact that indexes on primary key are created implicitly under such DBs as Oracle and MSSQL Server. Unfortunately this is not the case with Gupta SQL Base, where the index must be createdjdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.
Since this problem is DB specific, any ideas on how to incorporate functionality to force explicit index creation on PK, after table generation?
As I understand it I am faced with extending:
org.hibernate.cfg.Configuration org.hibernate.dialect.Dialect + my own dialect
I have less then a month of exposure with Hibernate so there are probably many misconceptions in the above. Please correct me if you see anything wrong.
Thanks,
Sergei
************************RELEVANT INFORMATION************** Hibernate version: Hibernate3
Full stack trace of any exception that occurs:
[java] 12:19:02,110 DEBUG SQL:290 - insert into NOTATION (NOTE, TYPE, OWNER_ID, CREATE_DATE) values (?, ?, ?, ?) [java] Hibernate: insert into NOTATION (NOTE, TYPE, OWNER_ID, CREATE_DATE) values (?, ?, ?, ?) [java] 12:19:02,110 DEBUG AbstractBatcher:341 - preparing statement [java] 12:19:02,157 DEBUG JDBCExceptionReporter:49 - SQL Exception [java] java.sql.SQLException: 01417 DLU TIC Table in incomplete state
[java] at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java :8 26) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:147) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:92) [java] at
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:195) [java] at
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:java:349) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :71) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :65) [java] at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatch er .java:125) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1653) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:2006) [java] at
jdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.42) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:232) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:137) [java] at org.hibernate.event.AbstractFlushingEventListener.performExecutions(Ab st ractFlushingEventListener.java:255) [java] at org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEven tL istener.java:26) [java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:814) [java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java: 75 ) [java] at org.hibernate.auction.Main.createNotation(Main.java:127) [java] at org.hibernate.auction.Main.main(Main.java:425) [java] 12:19:02,173 WARN JDBCExceptionReporter:57 - SQL Error: 0, SQLState: null [java] 12:19:02,173 ERROR JDBCExceptionReporter:58 - 01417 DLU TIC Table in incomplete state [java] 12:19:02,188 DEBUG JDBCExceptionReporter:49 - could not insert: [org.hibernate.auction.Notation] [insert into NOTATION (NOTE, T YPE, OWNER_ID, CREATE_DATE) values (?, ?, ?, ?)] [java] java.sql.SQLException: 01417 DLU TIC Table in incomplete state [java] at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java :8 26) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:147) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:92) [java] at
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:195) [java] at
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:java:349) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :71) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :65) [java] at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatch er .java:125) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1653) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:2006) [java] at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.42) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:232) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:137) [java] at org.hibernate.event.AbstractFlushingEventListener.performExecutions(Ab st ractFlushingEventListener.java:255) [java] at org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEven tL istener.java:26) [java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:814) [java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java: 75 ) [java] at org.hibernate.auction.Main.createNotation(Main.java:127) [java] at org.hibernate.auction.Main.main(Main.java:425) [java] 12:19:02,282 WARN JDBCExceptionReporter:57 - SQL Error: 0, SQLState: null [java] 12:19:02,282 ERROR JDBCExceptionReporter:58 - 01417 DLU TIC Table in incomplete state [java] 12:19:02,282 ERROR AbstractFlushingEventListener:258 - Could not synchronize database state with session [java] org.hibernate.exception.GenericJDBCException: could not insert: [org.hibernate.auction.Notation] [java] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException( SQ LStateConverter.java:82) [java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.ja va :70) [java] at
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:java:43) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1683) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:2006) [java] at
jdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.42) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:232) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:137) [java] at org.hibernate.event.AbstractFlushingEventListener.performExecutions(Ab st ractFlushingEventListener.java:255) [java] at org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEven tL istener.java:26) [java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:814) [java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java: 75 ) [java] at org.hibernate.auction.Main.createNotation(Main.java:127) [java] at org.hibernate.auction.Main.main(Main.java:425) [java] Caused by: java.sql.SQLException: 01417 DLU TIC Table in incomplete state [java] at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java :8 26) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:147) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:92) [java] at
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:195) [java] at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:349) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :71) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :65) [java] at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatch er .java:125) [java] Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [org.hibernate.auction.Notation] [java] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException( SQ LStateConverter.java:82) [java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.ja va :70) [java] at
java:43) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1683) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:2006) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1653) [java] ... 10 more [java] 12:19:02,407 DEBUG JDBCTransaction:99 - rollback [java] 12:19:02,423 DEBUG SessionImpl:363 - transaction completion [java] 12:19:02,423 DEBUG SessionImpl:232 - closing session [java] 12:19:02,423 DEBUG SessionImpl:311 - disconnecting session [java] 12:19:02,423 DEBUG AbstractBatcher:392 - closing JDBC connection (open
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:PreparedStatements: 1, globally: 1) (open ResultSets: 0, globally: 0) [java] 12:19:02,423 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1 [java] 12:19:02,423 DEBUG SessionImpl:363 - transaction completion [java] at
jdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.42) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:232) [java] at org.hibernate.impl.ActionQueue.executeActions(ActionQueue.java:137) [java] at org.hibernate.event.AbstractFlushingEventListener.performExecutions(Ab st ractFlushingEventListener.java:255) [java] at org.hibernate.event.DefaultFlushEventListener.onFlush(DefaultFlushEven tL istener.java:26) [java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:814) [java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java: 75 ) [java] at org.hibernate.auction.Main.createNotation(Main.java:127) [java] at org.hibernate.auction.Main.main(Main.java:425) [java] Caused by: java.sql.SQLException: 01417 DLU TIC Table in incomplete state [java] at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java :8 26) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:147) [java] at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStat em ent.java:92) [java] at
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:195) [java] at
returned:java:349) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :71) [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.ja va :65) [java] at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatch er .java:125) [java] at org.hibernate.persister.BasicEntityPersister.insert(BasicEntityPersist er .java:1653) [java] ... 10 more
BUILD FAILED C:\java\eclipse\workspace\HibernateSQLBase\build.xml:624: Java1
Name and version of the database you are using: Gupta SQL Base 7.6.0
The generated SQL (show_sql=true): [java] 12:19:01,751 DEBUG SchemaExport:154 - create table NOTATION ( [java] TYPE varchar(2) not null, [java] OWNER_ID varchar(40) not null,
[java] CREATE_DATE date not null, [java] NOTE LONG VARCHAR, [java] primary key (TYPE, OWNER_ID, CREATE_DATE) [java] )
-- Max Rydahl Andersen callto://max.rydahl.andersen
Hibernate [EMAIL PROTECTED] http://hibernate.org
JBoss Inc [EMAIL PROTECTED] http://jboss.com
-- Max Rydahl Andersen callto://max.rydahl.andersen
Hibernate [EMAIL PROTECTED] http://hibernate.org
JBoss Inc [EMAIL PROTECTED] http://jboss.com
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel