-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate and SQL server throwing - Invalid object name
PostPosted: Sat Apr 29, 2006 4:08 pm 
Newbie

Joined: Sat Apr 29, 2006 3:30 pm
Posts: 1
I created a simple table in MS Sql server 2000, I mapped a POJO and created the hibernate mappings. The table has 2 columns ID and Message.

When I try to insert a row I get the following exception:
Code:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'echo_message'.


I turned on log4j and it show where it is failing:
Code:
15:00:55,609 DEBUG JDBCExceptionReporter:63 - could not fetch initial value [select max(id) from echo_message]


It looks like it is unable o find the object in the database HDB. The interesting part is that the SQL account defaults into the master DB. If I set the SQL account to default to HDB the record is inserted.

It looks to me that when hibernate generates the SQL for getting the next ID it does not append the DB.dbo. Is this expected behavior and if yes what can I do to modify what is happening? All of our SQL accounts on the server default to master and we are required to prefix with DBName.dbo.

Also I noticed that Hibernate generates the correct syntax for the CRUD regardless of where the account defaults. See below:

Code:
15:00:55,515 DEBUG BasicEntityPersister:2225 - Insert 0: insert into HDB.dbo.echo_message (msg, id) values (?, ?)


Any help is greatly appreciated

Thanks

Max

Hibernate version: 3.0.5

Mapping documents:
Code:
<hibernate-mapping>
    <class name="madmax.db.EchoMessage" table="echo_message" schema="dbo" catalog="HDB">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="increment" />
        </id>
        <property name="msg" type="string">
            <column name="msg" />
        </property>
    </class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
Code:
EchoMessage message = new EchoMessage();
        message.setMsg("Hello Hibernate, from MyEclipse!");

        try {
           Session session = HibernateSessionFactory.currentSession();
           Transaction tx = session.beginTransaction();
           
           session.save(message);
           tx.commit();
           System.out.println("Save successful.");
        }
        catch (HibernateException e) {
            e.printStackTrace();
            System.out.println("Save failed.");
        }
        finally {
           try {
               HibernateSessionFactory.closeSession();
           } catch (HibernateException e1) {
              // do nothing
           }
        }


Full stack trace of any exception that occurs:
Code:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'echo_message'.
   at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
   at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
   at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
   at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
   at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
   at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
   at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:89)
   at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:45)
   at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
   at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
   at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
   at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)
   at org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)
   at madmax.text.MyTest.main(MyTest.java:58)


Name and version of the database you are using: SQL Server 2000 SP4

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
15:00:54,531 INFO Environment:464 - Hibernate 3.0.5
15:00:54,531 INFO Environment:477 - hibernate.properties not found
15:00:54,531 INFO Environment:510 - using CGLIB reflection optimizer
15:00:54,531 INFO Environment:540 - using JDK 1.4 java.sql.Timestamp handling
15:00:54,593 INFO Configuration:1110 - configuring from resource: /madmax/hibernate.cfg.xml
15:00:54,593 INFO Configuration:1081 - Configuration resource: /madmax/hibernate.cfg.xml
15:00:54,796 DEBUG DTDEntityResolver:42 - trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
15:00:54,812 DEBUG DTDEntityResolver:53 - found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
15:00:54,843 DEBUG Configuration:1067 - connection.username=USER
15:00:54,843 DEBUG Configuration:1067 - connection.url=jdbc:microsoft:sqlserver://localhost:1433
15:00:54,843 DEBUG Configuration:1067 - dialect=org.hibernate.dialect.SQLServerDialect
15:00:54,843 DEBUG Configuration:1067 - myeclipse.connection.profile=localhost
15:00:54,843 DEBUG Configuration:1067 - connection.password=PASSWORD
15:00:54,843 DEBUG Configuration:1067 - connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver
15:00:54,843 DEBUG Configuration:1067 - max_fetch_depth=1
15:00:54,843 DEBUG Configuration:1067 - show_sql=true
15:00:54,843 DEBUG Configuration:1262 - null<-org.dom4j.tree.DefaultAttribute@3e89c3 [Attribute: name resource value "madmax/db/EchoMessage.hbm.xml"]
15:00:54,843 INFO Configuration:444 - Mapping resource: madmax/db/EchoMessage.hbm.xml
15:00:54,859 DEBUG DTDEntityResolver:42 - trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
15:00:54,859 DEBUG DTDEntityResolver:53 - found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
15:00:54,937 INFO HbmBinder:260 - Mapping class: madmax.db.EchoMessage -> echo_message
15:00:54,953 DEBUG HbmBinder:1099 - Mapped property: id -> id
15:00:54,953 DEBUG HbmBinder:1099 - Mapped property: msg -> msg
15:00:54,953 INFO Configuration:1222 - Configured SessionFactory: null
15:00:54,953 DEBUG Configuration:1223 - properties: {hibernate.connection.password=PASSWORD, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\jre1.5.0_06\bin, java.vm.version=1.5.0_06-b05, hibernate.connection.username=USER, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD, java.runtime.version=1.5.0_06-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\Java\jre1.5.0_06\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2003, sun.jnu.encoding=Cp1252, java.library.path=C:\Program Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\BizFlow\bin;C:\Program Files\Documentum\Shared;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\IDM Computer Solutions\UEStudio, hibernate.myeclipse.connection.profile=localhost, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.2, connection.password=PASSWORD, user.home=C:\Documents and Settings\Administrator, user.timezone=America/New_York, connection.username=USER, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, myeclipse.connection.profile=localhost, show_sql=true, user.name=SysAdmin, java.class.path=C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\bin;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\antlr-2.7.5H3.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\asm.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\asm-attrs.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\cglib-2.1.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\commons-collections-2.1.1.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\commons-logging-1.0.4.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\dom4j-1.6.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\hibernate3.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jaas.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jaxen-1.1-beta-4.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jdbc2_0-stdext.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jta.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\log4j-1.2.9.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\xerces-2.6.2.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\xml-apis.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\msutil.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\msbase.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\mssqlserver.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\ehcache-1.1.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\jre1.5.0_06, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.SQLServerDialect, hibernate.connection.url=jdbc:microsoft:sqlserver://localhost:1433, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.5.0_06, java.ext.dirs=C:\Program Files\Java\jre1.5.0_06\lib\ext, sun.boot.class.path=C:\Program Files\Java\jre1.5.0_06\lib\rt.jar;C:\Program Files\Java\jre1.5.0_06\lib\i18n.jar;C:\Program Files\Java\jre1.5.0_06\lib\sunrsasign.jar;C:\Program Files\Java\jre1.5.0_06\lib\jsse.jar;C:\Program Files\Java\jre1.5.0_06\lib\jce.jar;C:\Program Files\Java\jre1.5.0_06\lib\charsets.jar;C:\Program Files\Java\jre1.5.0_06\classes, java.vendor=Sun Microsystems Inc., connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, file.separator=\, max_fetch_depth=1, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.max_fetch_depth=1, sun.desktop=windows, connection.url=jdbc:microsoft:sqlserver://localhost:1433, dialect=org.hibernate.dialect.SQLServerDialect, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
15:00:54,953 DEBUG Configuration:998 - Preparing to build session factory with filters : {}
15:00:54,953 INFO Configuration:875 - processing extends queue
15:00:54,953 INFO Configuration:879 - processing collection mappings
15:00:54,953 INFO Configuration:888 - processing association property references
15:00:54,953 INFO Configuration:917 - processing foreign key constraints
15:00:55,015 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
15:00:55,015 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
15:00:55,015 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
15:00:55,015 INFO DriverManagerConnectionProvider:80 - using driver: com.microsoft.jdbc.sqlserver.SQLServerDriver at URL: jdbc:microsoft:sqlserver://localhost:1433
15:00:55,015 INFO DriverManagerConnectionProvider:83 - connection properties: {user=USER, password=PASSWORD}
15:00:55,015 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
15:00:55,015 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
15:00:55,109 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:microsoft:sqlserver://localhost:1433, Isolation Level: 2
15:00:55,125 DEBUG SettingsFactory:295 - could not get database version from JDBC metadata
15:00:55,125 INFO SettingsFactory:77 - RDBMS: Microsoft SQL Server, version: Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

15:00:55,125 INFO SettingsFactory:78 - JDBC driver: SQLServer, version: 2.2.0040
15:00:55,140 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
15:00:55,156 INFO Dialect:92 - Using dialect: org.hibernate.dialect.SQLServerDialect
15:00:55,171 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
15:00:55,171 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
15:00:55,171 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled
15:00:55,171 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled
15:00:55,171 INFO SettingsFactory:144 - Scrollable result sets: enabled
15:00:55,171 DEBUG SettingsFactory:148 - Wrap result sets: disabled
15:00:55,171 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): disabled
15:00:55,171 INFO SettingsFactory:160 - Connection release mode: null
15:00:55,171 INFO SettingsFactory:184 - Maximum outer join fetch depth: 1
15:00:55,171 INFO SettingsFactory:187 - Default batch fetch size: 1
15:00:55,171 INFO SettingsFactory:191 - Generate SQL with comments: disabled
15:00:55,171 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled
15:00:55,171 INFO SettingsFactory:334 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
15:00:55,171 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
15:00:55,171 INFO SettingsFactory:203 - Query language substitutions: {}
15:00:55,171 INFO SettingsFactory:209 - Second-level cache: enabled
15:00:55,171 INFO SettingsFactory:213 - Query cache: disabled
15:00:55,171 INFO SettingsFactory:321 - Cache provider: org.hibernate.cache.EhCacheProvider
15:00:55,187 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
15:00:55,187 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
15:00:55,187 DEBUG SQLExceptionConverterFactory:52 - Using dialect defined converter
15:00:55,187 INFO SettingsFactory:257 - Echoing all SQL to stdout
15:00:55,187 INFO SettingsFactory:261 - Statistics: disabled
15:00:55,187 INFO SettingsFactory:265 - Deleted entity synthetic identifier rollback: disabled
15:00:55,187 INFO SettingsFactory:279 - Default entity-mode: pojo
15:00:55,281 INFO SessionFactoryImpl:152 - building session factory
15:00:55,281 DEBUG SessionFactoryImpl:161 - Session factory constructed with filter configurations : {}
15:00:55,281 DEBUG SessionFactoryImpl:164 - instantiating session factory with properties: {hibernate.connection.password=PASSWORD, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\jre1.5.0_06\bin, java.vm.version=1.5.0_06-b05, hibernate.connection.username=USER, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD, java.runtime.version=1.5.0_06-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Program Files\Java\jre1.5.0_06\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2003, sun.jnu.encoding=Cp1252, java.library.path=C:\Program Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\BizFlow\bin;C:\Program Files\Documentum\Shared;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\IDM Computer Solutions\UEStudio, hibernate.myeclipse.connection.profile=localhost, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.2, connection.password=PASSWORD, user.home=C:\Documents and Settings\Administrator, user.timezone=America/New_York, connection.username=USER, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, myeclipse.connection.profile=localhost, show_sql=true, user.name=SysAdmin, java.class.path=C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\bin;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\antlr-2.7.5H3.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\asm.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\asm-attrs.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\cglib-2.1.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\commons-collections-2.1.1.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\commons-logging-1.0.4.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\dom4j-1.6.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\hibernate3.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jaas.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jaxen-1.1-beta-4.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jdbc2_0-stdext.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\jta.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\log4j-1.2.9.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\xerces-2.6.2.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\xml-apis.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\msutil.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\msbase.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\mssqlserver.jar;C:\Documents and Settings\Administrator\My Documents\Development\Java\WEB-Apps\HBD\lib\ehcache-1.1.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\jre1.5.0_06, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.SQLServerDialect, hibernate.connection.url=jdbc:microsoft:sqlserver://localhost:1433, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.5.0_06, java.ext.dirs=C:\Program Files\Java\jre1.5.0_06\lib\ext, sun.boot.class.path=C:\Program Files\Java\jre1.5.0_06\lib\rt.jar;C:\Program Files\Java\jre1.5.0_06\lib\i18n.jar;C:\Program Files\Java\jre1.5.0_06\lib\sunrsasign.jar;C:\Program Files\Java\jre1.5.0_06\lib\jsse.jar;C:\Program Files\Java\jre1.5.0_06\lib\jce.jar;C:\Program Files\Java\jre1.5.0_06\lib\charsets.jar;C:\Program Files\Java\jre1.5.0_06\classes, java.vendor=Sun Microsystems Inc., connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, file.separator=\, max_fetch_depth=1, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.max_fetch_depth=1, sun.desktop=windows, connection.url=jdbc:microsoft:sqlserver://localhost:1433, dialect=org.hibernate.dialect.SQLServerDialect, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86}
15:00:55,296 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Documents%20and%20Settings/Administrator/My%20Documents/Development/Java/WEB-Apps/HBD/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
15:00:55,500 DEBUG BasicEntityPersister:2220 - Static SQL for entity: madmax.db.EchoMessage
15:00:55,500 DEBUG BasicEntityPersister:2222 - Version select: select id from HDB.dbo.echo_message where id =?
15:00:55,500 DEBUG BasicEntityPersister:2223 - Snapshot select: select echomessag_.id, echomessag_.msg as msg0_ from HDB.dbo.echo_message echomessag_ where echomessag_.id=?
15:00:55,515 DEBUG BasicEntityPersister:2225 - Insert 0: insert into HDB.dbo.echo_message (msg, id) values (?, ?)
15:00:55,515 DEBUG BasicEntityPersister:2226 - Update 0: update HDB.dbo.echo_message set msg=? where id=?
15:00:55,515 DEBUG BasicEntityPersister:2227 - Delete 0: delete from HDB.dbo.echo_message where id=?
15:00:55,531 DEBUG EntityLoader:95 - Static select for entity madmax.db.EchoMessage: select echomessag0_.id as id0_, echomessag0_.msg as msg0_0_ from HDB.dbo.echo_message echomessag0_ where echomessag0_.id=?
15:00:55,531 DEBUG EntityLoader:95 - Static select for entity madmax.db.EchoMessage: select echomessag0_.id as id0_, echomessag0_.msg as msg0_0_ from HDB.dbo.echo_message echomessag0_ where echomessag0_.id=?
15:00:55,531 DEBUG EntityLoader:95 - Static select for entity madmax.db.EchoMessage: select echomessag0_.id as id0_, echomessag0_.msg as msg0_0_ from HDB.dbo.echo_message echomessag0_ where echomessag0_.id=?
15:00:55,531 DEBUG EntityLoader:95 - Static select for entity madmax.db.EchoMessage: select echomessag0_.id as id0_, echomessag0_.msg as msg0_0_ from HDB.dbo.echo_message echomessag0_ where echomessag0_.id=?
15:00:55,546 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
15:00:55,546 DEBUG SessionFactoryObjectFactory:76 - registered: 402881170ae7065f010ae706606b0000 (unnamed)
15:00:55,546 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
15:00:55,546 DEBUG SessionFactoryImpl:262 - instantiated session factory
15:00:55,546 INFO SessionFactoryImpl:379 - Checking 0 named queries
15:00:55,578 DEBUG SessionImpl:250 - opened session at timestamp: 4695397398716416
15:00:55,578 DEBUG JDBCTransaction:46 - begin
15:00:55,578 DEBUG ConnectionManager:296 - opening JDBC connection
15:00:55,578 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
15:00:55,578 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
15:00:55,593 DEBUG JDBCTransaction:50 - current autocommit status: false
true
org.hibernate.transaction.JDBCTransaction@69d02b
15:00:55,593 DEBUG DefaultSaveOrUpdateEventListener:159 - saving transient instance
15:00:55,593 DEBUG IncrementGenerator:82 - fetching initial value: select max(id) from echo_message
15:00:55,593 DEBUG SQL:85 - select max(id) from echo_message
15:00:55,609 DEBUG JDBCExceptionReporter:63 - could not fetch initial value [select max(id) from echo_message]
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'echo_message'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:89)
at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:45)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)
at madmax.text.MyTest.main(MyTest.java:58)
15:00:55,625 WARN JDBCExceptionReporter:71 - SQL Error: 208, SQLState: 42S02
15:00:55,625 ERROR JDBCExceptionReporter:72 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'echo_message'.
org.hibernate.exception.SQLGrammarException: could not fetch initial value
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:107)
at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:45)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)
at madmax.text.MyTest.main(MyTest.java:58)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'echo_message'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:89)
... 10 more
Save failed.
15:00:55,640 DEBUG SessionImpl:269 - closing session
15:00:55,640 DEBUG ConnectionManager:317 - closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
15:00:55,640 DEBUG JDBCExceptionReporter:40 - SQL Warning
java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to master
at com.microsoft.jdbc.base.BaseWarnings.createSQLWarning(Unknown Source)
at com.microsoft.jdbc.base.BaseWarnings.get(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getWarnings(Unknown Source)
at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:325)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:262)
at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:194)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:289)
at madmax.HibernateSessionFactory.closeSession(HibernateSessionFactory.java:74)
at madmax.text.MyTest.main(MyTest.java:69)
15:00:55,656 WARN JDBCExceptionReporter:48 - SQL Warning: 0, SQLState:
15:00:55,656 WARN JDBCExceptionReporter:49 - [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to master
15:00:55,656 WARN JDBCExceptionReporter:48 - SQL Warning: 5701, SQLState: 01000
15:00:55,656 WARN JDBCExceptionReporter:49 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed database context to 'master'.
15:00:55,656 WARN JDBCExceptionReporter:48 - SQL Warning: 0, SQLState:
15:00:55,656 WARN JDBCExceptionReporter:49 - [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to us_english
15:00:55,656 WARN JDBCExceptionReporter:48 - SQL Warning: 5703, SQLState: 01000
15:00:55,656 WARN JDBCExceptionReporter:49 - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed language setting to us_english.
15:00:55,656 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1


Code:
Code:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.