Hallo
Bin dabei meinen ersten DB Zugriff mittels Hibernate zu vollziehen.
Es sieht auch alles recht gut aus, jedoch wird der Datensatz nicht in die Tabelle geschrieben.
Die Klasse:
Die config:
Die Logs im Debug modus:
2007-09-02 10:28:08,202 INFO [org.hibernate.cfg.Environment] - Hibernate 3.2.5
2007-09-02 10:28:08,206 INFO [org.hibernate.cfg.Environment] - hibernate.properties not found
2007-09-02 10:28:08,208 INFO [org.hibernate.cfg.Environment] - Bytecode provider name : cglib
2007-09-02 10:28:08,213 INFO [org.hibernate.cfg.Environment] - using JDK 1.4 java.sql.Timestamp handling
2007-09-02 10:28:08,273 INFO [org.hibernate.cfg.Configuration] - configuring from resource: /hibernate.cfg.xml
2007-09-02 10:28:08,273 INFO [org.hibernate.cfg.Configuration] - Configuration resource: /hibernate.cfg.xml
2007-09-02 10:28:08,307 DEBUG [org.hibernate.util.DTDEntityResolver] - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
2007-09-02 10:28:08,307 DEBUG [org.hibernate.util.DTDEntityResolver] - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2007-09-02 10:28:08,308 DEBUG [org.hibernate.util.DTDEntityResolver] - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.driver_class=com.mysql.jdbc.Driver
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.url=jdbc:mysql://localhost/testdb
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.username=test
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.password=12345678
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.pool_size=1
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - dialect=org.hibernate.dialect.MySQLDialect
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - current_session_context_class=thread
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - cache.provider_class=org.hibernate.cache.NoCacheProvider
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - show_sql=true
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - hbm2ddl.auto=create
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - null<-org.dom4j.tree.DefaultAttribute@540408 [Attribute: name resource value "events/Event.hbm.xml"]
2007-09-02 10:28:08,340 INFO [org.hibernate.cfg.Configuration] - Reading mappings from resource : events/Event.hbm.xml
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2007-09-02 10:28:08,419 INFO [org.hibernate.cfg.HbmBinder] - Mapping class: events.Event -> EVENTS
2007-09-02 10:28:08,434 DEBUG [org.hibernate.cfg.HbmBinder] - Mapped property: id -> EVENT_ID
2007-09-02 10:28:08,441 DEBUG [org.hibernate.cfg.HbmBinder] - Mapped property: title -> EVENT_TITLE
2007-09-02 10:28:08,441 INFO [org.hibernate.cfg.Configuration] - Configured SessionFactory: null
2007-09-02 10:28:08,441 DEBUG [org.hibernate.cfg.Configuration] - properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost/testdb, sun.management.compiler=HotSpot Client Compiler, hbm2ddl.auto=create, os.name=Windows Vista, sun.boot.class.path=C:\Program Files (x86)\Java\jre1.6.0_01\lib\resources.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\rt.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jsse.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jce.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\charsets.jar;C:\Program Files (x86)\Java\jre1.6.0_01\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_01-b06, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=Markus, connection.driver_class=com.mysql.jdbc.Driver, current_session_context_class=thread, user.language=de, sun.boot.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_01, user.timezone=Europe/Berlin, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=AT, connection.url=jdbc:mysql://localhost/testdb, java.home=C:\Program Files (x86)\Java\jre1.6.0_01, java.vm.info=mixed mode, sharing, os.version=6.0, path.separator=;, connection.password=12345678, java.vm.version=1.6.0_01-b06, hibernate.connection.password=12345678, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=test, user.home=C:\Users\Markus, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Java\jre1.6.0_02\bin\client;C:\Program Files (x86)\Java\jre1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Java\jdk1.6.0_01\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=test, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=C:\Developement\WorkspaceEclipse\HibernateExample\bin;
C:\Developement\JLibaries\hibernate-3.2\lib\antlr-2.7.6.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm-attrs.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\cglib-2.1.3.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-collections-2.1.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-logging-1.0.4.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\dom4j-1.6.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\jta.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\log4j-1.2.11.jar;
C:\Developement\JLibaries\hibernate-3.2\hibernate3.jar;
C:\Developement\JLibaries\mysql-connector-java-5.0.7\mysql-connector-java-5.0.7-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, connection.pool_size=1, java.io.tmpdir=C:\Users\Markus\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=C:\Developement\WorkspaceEclipse\HibernateExample, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.6, hibernate.show_sql=true, hibernate.connection.pool_size=1}
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - Preparing to build session factory with filters : {}
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - Using Hibernate built-in connection pool (not for production use!)
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - Hibernate connection pool size: 1
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - autocommit mode: false
2007-09-02 10:28:08,515 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/testdb
2007-09-02 10:28:08,515 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - connection properties: {user=test, password=12345678}
2007-09-02 10:28:08,515 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:08,515 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - opening new JDBC connection
2007-09-02 10:28:08,759 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - created connection to: jdbc:mysql://localhost/testdb, Isolation Level: 4
2007-09-02 10:28:08,760 INFO [org.hibernate.cfg.SettingsFactory] - RDBMS: MySQL, version: 5.0.45-community-nt
2007-09-02 10:28:08,760 INFO [org.hibernate.cfg.SettingsFactory] - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.7 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ )
2007-09-02 10:28:08,760 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:08,774 INFO [org.hibernate.dialect.Dialect] - Using dialect: org.hibernate.dialect.MySQLDialect
2007-09-02 10:28:08,778 INFO [org.hibernate.transaction.TransactionFactoryFactory] - Using default transaction strategy (direct JDBC transactions)
2007-09-02 10:28:08,780 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - Automatic flush during beforeCompletion(): disabled
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - Automatic session close at end of transaction: disabled
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - JDBC batch size: 15
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - JDBC batch updates for versioned data: disabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - Scrollable result sets: enabled
2007-09-02 10:28:08,781 DEBUG [org.hibernate.cfg.SettingsFactory] - Wrap result sets: disabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - JDBC3 getGeneratedKeys(): enabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - Connection release mode: auto
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Maximum outer join fetch depth: 2
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Default batch fetch size: 1
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Generate SQL with comments: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Order SQL updates by primary key: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Order SQL inserts for batching: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2007-09-02 10:28:08,784 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - Using ASTQueryTranslatorFactory
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Query language substitutions: {}
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - JPA-QL strict compliance: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Second-level cache: enabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Query cache: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Cache provider: org.hibernate.cache.NoCacheProvider
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Optimize cache for minimal puts: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Structured second-level cache entries: disabled
2007-09-02 10:28:08,785 DEBUG [org.hibernate.exception.SQLExceptionConverterFactory] - Using dialect defined converter
2007-09-02 10:28:08,790 INFO [org.hibernate.cfg.SettingsFactory] - Echoing all SQL to stdout
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Statistics: disabled
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Deleted entity synthetic identifier rollback: disabled
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Default entity-mode: pojo
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Named query checking : enabled
2007-09-02 10:28:08,817 INFO [org.hibernate.impl.SessionFactoryImpl] - building session factory
2007-09-02 10:28:08,818 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Session factory constructed with filter configurations : {}
2007-09-02 10:28:08,818 DEBUG [org.hibernate.impl.SessionFactoryImpl] - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost/testdb, sun.management.compiler=HotSpot Client Compiler, os.name=Windows Vista, hbm2ddl.auto=create, sun.boot.class.path=C:\Program Files (x86)\Java\jre1.6.0_01\lib\resources.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\rt.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jsse.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jce.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\charsets.jar;C:\Program Files (x86)\Java\jre1.6.0_01\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_01-b06, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=Markus, connection.driver_class=com.mysql.jdbc.Driver, current_session_context_class=thread, user.language=de, sun.boot.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_01, user.timezone=Europe/Berlin, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=AT, connection.url=jdbc:mysql://localhost/testdb, java.home=C:\Program Files (x86)\Java\jre1.6.0_01, java.vm.info=mixed mode, sharing, os.version=6.0, path.separator=;, connection.password=12345678, java.vm.version=1.6.0_01-b06, hibernate.connection.password=12345678, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=test, user.home=C:\Users\Markus, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Java\jre1.6.0_02\bin\client;C:\Program Files (x86)\Java\jre1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Java\jdk1.6.0_01\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=test, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=C:\Developement\WorkspaceEclipse\HibernateExample\bin;C:\Developement\JLibaries\hibernate-3.2\lib\antlr-2.7.6.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm.jar;C:\Developement\JLibaries\hibernate-3.2\lib\asm-attrs.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\cglib-2.1.3.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-collections-2.1.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-logging-1.0.4.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\dom4j-1.6.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\jta.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\log4j-1.2.11.jar;
C:\Developement\JLibaries\hibernate-3.2\hibernate3.jar;
C:\Developement\JLibaries\mysql-connector-java-5.0.7\mysql-connector-java-5.0.7-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, connection.pool_size=1, java.io.tmpdir=C:\Users\Markus\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=C:\Developement\WorkspaceEclipse\HibernateExample, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.6, hibernate.connection.pool_size=1, hibernate.show_sql=true}
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Static SQL for entity: events.Event
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Version select: select EVENT_ID from EVENTS where EVENT_ID =?
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Snapshot select: select event_.EVENT_ID, event_.EVENT_TITLE as EVENT2_0_ from EVENTS event_ where event_.EVENT_ID=?
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Insert 0: insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Update 0: update EVENTS set EVENT_TITLE=? where EVENT_ID=?
2007-09-02 10:28:09,034 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Delete 0: delete from EVENTS where EVENT_ID=?
2007-09-02 10:28:09,056 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,065 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for action ACTION_MERGE on entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,065 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for action ACTION_REFRESH on entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,066 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - initializing class SessionFactoryObjectFactory
2007-09-02 10:28:09,068 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - registered: d0ec91ae14c555800114c55581e90000 (unnamed)
2007-09-02 10:28:09,068 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - Not binding factory to JNDI, no JNDI name configured
2007-09-02 10:28:09,068 DEBUG [org.hibernate.impl.SessionFactoryImpl] - instantiated session factory
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:09,073 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - Running hbm2ddl schema export
2007-09-02 10:28:09,073 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - import file not found: /import.sql
2007-09-02 10:28:09,073 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - exporting generated schema to database
2007-09-02 10:28:09,073 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:09,074 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - using pooled JDBC connection, pool size: 0
2007-09-02 10:28:09,074 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - drop table if exists EVENTS
2007-09-02 10:28:09,174 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - create table EVENTS (EVENT_ID integer not null, EVENT_TITLE varchar(255), primary key (EVENT_ID))
2007-09-02 10:28:09,257 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - schema export complete
2007-09-02 10:28:09,258 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:09,262 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Checking 0 named HQL queries
2007-09-02 10:28:09,262 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Checking 0 named SQL queries
2007-09-02 10:28:09,303 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 11887216892
1, TestTitle
vor save
2007-09-02 10:28:09,306 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
2007-09-02 10:28:09,307 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - generated identifier: 1, using strategy: org.hibernate.id.Assigned
2007-09-02 10:28:09,308 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [events.Event#1]
nach save
2007-09-02 10:28:09,321 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - flushing session
2007-09-02 10:28:09,322 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - processing flush-time cascades
2007-09-02 10:28:09,323 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - dirty checking collections
2007-09-02 10:28:09,323 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushing entities and processing referenced collections
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Processing unreferenced collections
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Scheduling collection removes/(re)creates/updates
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-09-02 10:28:09,326 DEBUG [org.hibernate.pretty.Printer] - listing entities:
2007-09-02 10:28:09,326 DEBUG [org.hibernate.pretty.Printer] - events.Event{id=1, title=TestTitle}
2007-09-02 10:28:09,326 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - executing flush
2007-09-02 10:28:09,326 DEBUG [org.hibernate.jdbc.ConnectionManager] - registering flush begin
2007-09-02 10:28:09,326 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Inserting entity: [events.Event#1]
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.ConnectionManager] - opening JDBC connection
2007-09-02 10:28:09,330 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:09,330 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - using pooled JDBC connection, pool size: 0
2007-09-02 10:28:09,330 DEBUG [org.hibernate.SQL] - insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
Hibernate: insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2007-09-02 10:28:09,340 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Dehydrating entity: [events.Event#1]
2007-09-02 10:28:09,341 DEBUG [org.hibernate.type.StringType] - binding 'TestTitle' to parameter: 1
2007-09-02 10:28:09,341 DEBUG [org.hibernate.type.IntegerType] - binding '1' to parameter: 2
2007-09-02 10:28:09,342 DEBUG [org.hibernate.jdbc.AbstractBatcher] - Executing batch size: 1
2007-09-02 10:28:09,342 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - registering flush end
2007-09-02 10:28:09,343 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - post flush
2007-09-02 10:28:09,343 DEBUG [org.hibernate.impl.SessionImpl] - closing session
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - performing cleanup
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2007-09-02 10:28:09,343 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction completion
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - aggressively releasing JDBC connection
2007-09-02 10:28:09,343 DEBUG [org.hibernate.impl.SessionImpl] - after transaction completion
Die Tabelle wird zwar verworfen und neu erstellt, der Datensatz fehlt aber.
Hoffe es kann mir jemand helfen
EDIT by Wildcard
dein gigantischer Classpath ist zu viel für das Board, Umbrüche eingefügt, CodeTags entfernt :wink:
Bin dabei meinen ersten DB Zugriff mittels Hibernate zu vollziehen.
Es sieht auch alles recht gut aus, jedoch wird der Datensatz nicht in die Tabelle geschrieben.
Die Klasse:
Code:
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = null;
session = sessionFactory.openSession();
Event event = new Event();
event.setId(1);
event.setTitle("TestTitle");
System.out.println(event.getId() + ", " + event.getTitle());
System.out.println("vor save");
session.save(event);
System.out.println("nach save");
session.flush();
session.close();
Die config:
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/testdb</property>
<property name="connection.username">test</property>
<property name="connection.password">12345678</property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">create</property>
<mapping resource="events/Event.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Die Logs im Debug modus:
2007-09-02 10:28:08,202 INFO [org.hibernate.cfg.Environment] - Hibernate 3.2.5
2007-09-02 10:28:08,206 INFO [org.hibernate.cfg.Environment] - hibernate.properties not found
2007-09-02 10:28:08,208 INFO [org.hibernate.cfg.Environment] - Bytecode provider name : cglib
2007-09-02 10:28:08,213 INFO [org.hibernate.cfg.Environment] - using JDK 1.4 java.sql.Timestamp handling
2007-09-02 10:28:08,273 INFO [org.hibernate.cfg.Configuration] - configuring from resource: /hibernate.cfg.xml
2007-09-02 10:28:08,273 INFO [org.hibernate.cfg.Configuration] - Configuration resource: /hibernate.cfg.xml
2007-09-02 10:28:08,307 DEBUG [org.hibernate.util.DTDEntityResolver] - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
2007-09-02 10:28:08,307 DEBUG [org.hibernate.util.DTDEntityResolver] - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2007-09-02 10:28:08,308 DEBUG [org.hibernate.util.DTDEntityResolver] - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.driver_class=com.mysql.jdbc.Driver
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.url=jdbc:mysql://localhost/testdb
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.username=test
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.password=12345678
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - connection.pool_size=1
2007-09-02 10:28:08,339 DEBUG [org.hibernate.cfg.Configuration] - dialect=org.hibernate.dialect.MySQLDialect
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - current_session_context_class=thread
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - cache.provider_class=org.hibernate.cache.NoCacheProvider
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - show_sql=true
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - hbm2ddl.auto=create
2007-09-02 10:28:08,340 DEBUG [org.hibernate.cfg.Configuration] - null<-org.dom4j.tree.DefaultAttribute@540408 [Attribute: name resource value "events/Event.hbm.xml"]
2007-09-02 10:28:08,340 INFO [org.hibernate.cfg.Configuration] - Reading mappings from resource : events/Event.hbm.xml
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
2007-09-02 10:28:08,342 DEBUG [org.hibernate.util.DTDEntityResolver] - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
2007-09-02 10:28:08,419 INFO [org.hibernate.cfg.HbmBinder] - Mapping class: events.Event -> EVENTS
2007-09-02 10:28:08,434 DEBUG [org.hibernate.cfg.HbmBinder] - Mapped property: id -> EVENT_ID
2007-09-02 10:28:08,441 DEBUG [org.hibernate.cfg.HbmBinder] - Mapped property: title -> EVENT_TITLE
2007-09-02 10:28:08,441 INFO [org.hibernate.cfg.Configuration] - Configured SessionFactory: null
2007-09-02 10:28:08,441 DEBUG [org.hibernate.cfg.Configuration] - properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost/testdb, sun.management.compiler=HotSpot Client Compiler, hbm2ddl.auto=create, os.name=Windows Vista, sun.boot.class.path=C:\Program Files (x86)\Java\jre1.6.0_01\lib\resources.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\rt.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jsse.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jce.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\charsets.jar;C:\Program Files (x86)\Java\jre1.6.0_01\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_01-b06, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=Markus, connection.driver_class=com.mysql.jdbc.Driver, current_session_context_class=thread, user.language=de, sun.boot.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_01, user.timezone=Europe/Berlin, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=AT, connection.url=jdbc:mysql://localhost/testdb, java.home=C:\Program Files (x86)\Java\jre1.6.0_01, java.vm.info=mixed mode, sharing, os.version=6.0, path.separator=;, connection.password=12345678, java.vm.version=1.6.0_01-b06, hibernate.connection.password=12345678, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=test, user.home=C:\Users\Markus, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Java\jre1.6.0_02\bin\client;C:\Program Files (x86)\Java\jre1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Java\jdk1.6.0_01\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=test, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=C:\Developement\WorkspaceEclipse\HibernateExample\bin;
C:\Developement\JLibaries\hibernate-3.2\lib\antlr-2.7.6.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm-attrs.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\cglib-2.1.3.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-collections-2.1.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-logging-1.0.4.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\dom4j-1.6.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\jta.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\log4j-1.2.11.jar;
C:\Developement\JLibaries\hibernate-3.2\hibernate3.jar;
C:\Developement\JLibaries\mysql-connector-java-5.0.7\mysql-connector-java-5.0.7-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, connection.pool_size=1, java.io.tmpdir=C:\Users\Markus\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=C:\Developement\WorkspaceEclipse\HibernateExample, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.6, hibernate.show_sql=true, hibernate.connection.pool_size=1}
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - Preparing to build session factory with filters : {}
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:08,442 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - Using Hibernate built-in connection pool (not for production use!)
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - Hibernate connection pool size: 1
2007-09-02 10:28:08,508 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - autocommit mode: false
2007-09-02 10:28:08,515 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/testdb
2007-09-02 10:28:08,515 INFO [org.hibernate.connection.DriverManagerConnectionProvider] - connection properties: {user=test, password=12345678}
2007-09-02 10:28:08,515 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:08,515 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - opening new JDBC connection
2007-09-02 10:28:08,759 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - created connection to: jdbc:mysql://localhost/testdb, Isolation Level: 4
2007-09-02 10:28:08,760 INFO [org.hibernate.cfg.SettingsFactory] - RDBMS: MySQL, version: 5.0.45-community-nt
2007-09-02 10:28:08,760 INFO [org.hibernate.cfg.SettingsFactory] - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.7 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ )
2007-09-02 10:28:08,760 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:08,774 INFO [org.hibernate.dialect.Dialect] - Using dialect: org.hibernate.dialect.MySQLDialect
2007-09-02 10:28:08,778 INFO [org.hibernate.transaction.TransactionFactoryFactory] - Using default transaction strategy (direct JDBC transactions)
2007-09-02 10:28:08,780 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - Automatic flush during beforeCompletion(): disabled
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - Automatic session close at end of transaction: disabled
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - JDBC batch size: 15
2007-09-02 10:28:08,780 INFO [org.hibernate.cfg.SettingsFactory] - JDBC batch updates for versioned data: disabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - Scrollable result sets: enabled
2007-09-02 10:28:08,781 DEBUG [org.hibernate.cfg.SettingsFactory] - Wrap result sets: disabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - JDBC3 getGeneratedKeys(): enabled
2007-09-02 10:28:08,781 INFO [org.hibernate.cfg.SettingsFactory] - Connection release mode: auto
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Maximum outer join fetch depth: 2
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Default batch fetch size: 1
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Generate SQL with comments: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Order SQL updates by primary key: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Order SQL inserts for batching: disabled
2007-09-02 10:28:08,782 INFO [org.hibernate.cfg.SettingsFactory] - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2007-09-02 10:28:08,784 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - Using ASTQueryTranslatorFactory
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Query language substitutions: {}
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - JPA-QL strict compliance: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Second-level cache: enabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Query cache: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Cache provider: org.hibernate.cache.NoCacheProvider
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Optimize cache for minimal puts: disabled
2007-09-02 10:28:08,784 INFO [org.hibernate.cfg.SettingsFactory] - Structured second-level cache entries: disabled
2007-09-02 10:28:08,785 DEBUG [org.hibernate.exception.SQLExceptionConverterFactory] - Using dialect defined converter
2007-09-02 10:28:08,790 INFO [org.hibernate.cfg.SettingsFactory] - Echoing all SQL to stdout
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Statistics: disabled
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Deleted entity synthetic identifier rollback: disabled
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Default entity-mode: pojo
2007-09-02 10:28:08,791 INFO [org.hibernate.cfg.SettingsFactory] - Named query checking : enabled
2007-09-02 10:28:08,817 INFO [org.hibernate.impl.SessionFactoryImpl] - building session factory
2007-09-02 10:28:08,818 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Session factory constructed with filter configurations : {}
2007-09-02 10:28:08,818 DEBUG [org.hibernate.impl.SessionFactoryImpl] - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., show_sql=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost/testdb, sun.management.compiler=HotSpot Client Compiler, os.name=Windows Vista, hbm2ddl.auto=create, sun.boot.class.path=C:\Program Files (x86)\Java\jre1.6.0_01\lib\resources.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\rt.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jsse.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\jce.jar;C:\Program Files (x86)\Java\jre1.6.0_01\lib\charsets.jar;C:\Program Files (x86)\Java\jre1.6.0_01\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_01-b06, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, user.name=Markus, connection.driver_class=com.mysql.jdbc.Driver, current_session_context_class=thread, user.language=de, sun.boot.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_01, user.timezone=Europe/Berlin, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=50.0, user.country=AT, connection.url=jdbc:mysql://localhost/testdb, java.home=C:\Program Files (x86)\Java\jre1.6.0_01, java.vm.info=mixed mode, sharing, os.version=6.0, path.separator=;, connection.password=12345678, java.vm.version=1.6.0_01-b06, hibernate.connection.password=12345678, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=test, user.home=C:\Users\Markus, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto=create, java.library.path=C:\Program Files (x86)\Java\jre1.6.0_01\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Java\jre1.6.0_02\bin\client;C:\Program Files (x86)\Java\jre1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\Java\jdk1.6.0_01\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=com.mysql.jdbc.Driver, connection.username=test, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=C:\Developement\WorkspaceEclipse\HibernateExample\bin;C:\Developement\JLibaries\hibernate-3.2\lib\antlr-2.7.6.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\asm.jar;C:\Developement\JLibaries\hibernate-3.2\lib\asm-attrs.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\cglib-2.1.3.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-collections-2.1.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\commons-logging-1.0.4.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\dom4j-1.6.1.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\jta.jar;
C:\Developement\JLibaries\hibernate-3.2\lib\log4j-1.2.11.jar;
C:\Developement\JLibaries\hibernate-3.2\hibernate3.jar;
C:\Developement\JLibaries\mysql-connector-java-5.0.7\mysql-connector-java-5.0.7-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=, connection.pool_size=1, java.io.tmpdir=C:\Users\Markus\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files (x86)\Java\jre1.6.0_01\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=C:\Developement\WorkspaceEclipse\HibernateExample, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.cache.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.6, hibernate.connection.pool_size=1, hibernate.show_sql=true}
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Static SQL for entity: events.Event
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Version select: select EVENT_ID from EVENTS where EVENT_ID =?
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Snapshot select: select event_.EVENT_ID, event_.EVENT_TITLE as EVENT2_0_ from EVENTS event_ where event_.EVENT_ID=?
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Insert 0: insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
2007-09-02 10:28:09,031 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Update 0: update EVENTS set EVENT_TITLE=? where EVENT_ID=?
2007-09-02 10:28:09,034 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Delete 0: delete from EVENTS where EVENT_ID=?
2007-09-02 10:28:09,056 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,057 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=? for update
2007-09-02 10:28:09,065 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for action ACTION_MERGE on entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,065 DEBUG [org.hibernate.loader.entity.EntityLoader] - Static select for action ACTION_REFRESH on entity events.Event: select event0_.EVENT_ID as EVENT1_0_0_, event0_.EVENT_TITLE as EVENT2_0_0_ from EVENTS event0_ where event0_.EVENT_ID=?
2007-09-02 10:28:09,066 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - initializing class SessionFactoryObjectFactory
2007-09-02 10:28:09,068 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - registered: d0ec91ae14c555800114c55581e90000 (unnamed)
2007-09-02 10:28:09,068 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - Not binding factory to JNDI, no JNDI name configured
2007-09-02 10:28:09,068 DEBUG [org.hibernate.impl.SessionFactoryImpl] - instantiated session factory
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:09,072 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing extends queue
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing collection mappings
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing native query and ResultSetMapping mappings
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing association property references
2007-09-02 10:28:09,073 DEBUG [org.hibernate.cfg.Configuration] - processing foreign key constraints
2007-09-02 10:28:09,073 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - Running hbm2ddl schema export
2007-09-02 10:28:09,073 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - import file not found: /import.sql
2007-09-02 10:28:09,073 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - exporting generated schema to database
2007-09-02 10:28:09,073 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:09,074 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - using pooled JDBC connection, pool size: 0
2007-09-02 10:28:09,074 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - drop table if exists EVENTS
2007-09-02 10:28:09,174 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] - create table EVENTS (EVENT_ID integer not null, EVENT_TITLE varchar(255), primary key (EVENT_ID))
2007-09-02 10:28:09,257 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] - schema export complete
2007-09-02 10:28:09,258 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:09,262 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Checking 0 named HQL queries
2007-09-02 10:28:09,262 DEBUG [org.hibernate.impl.SessionFactoryImpl] - Checking 0 named SQL queries
2007-09-02 10:28:09,303 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 11887216892
1, TestTitle
vor save
2007-09-02 10:28:09,306 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] - saving transient instance
2007-09-02 10:28:09,307 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - generated identifier: 1, using strategy: org.hibernate.id.Assigned
2007-09-02 10:28:09,308 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [events.Event#1]
nach save
2007-09-02 10:28:09,321 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - flushing session
2007-09-02 10:28:09,322 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - processing flush-time cascades
2007-09-02 10:28:09,323 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - dirty checking collections
2007-09-02 10:28:09,323 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushing entities and processing referenced collections
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Processing unreferenced collections
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Scheduling collection removes/(re)creates/updates
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2007-09-02 10:28:09,325 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-09-02 10:28:09,326 DEBUG [org.hibernate.pretty.Printer] - listing entities:
2007-09-02 10:28:09,326 DEBUG [org.hibernate.pretty.Printer] - events.Event{id=1, title=TestTitle}
2007-09-02 10:28:09,326 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - executing flush
2007-09-02 10:28:09,326 DEBUG [org.hibernate.jdbc.ConnectionManager] - registering flush begin
2007-09-02 10:28:09,326 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Inserting entity: [events.Event#1]
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.ConnectionManager] - opening JDBC connection
2007-09-02 10:28:09,330 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - total checked-out connections: 0
2007-09-02 10:28:09,330 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - using pooled JDBC connection, pool size: 0
2007-09-02 10:28:09,330 DEBUG [org.hibernate.SQL] - insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
Hibernate: insert into EVENTS (EVENT_TITLE, EVENT_ID) values (?, ?)
2007-09-02 10:28:09,330 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2007-09-02 10:28:09,340 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Dehydrating entity: [events.Event#1]
2007-09-02 10:28:09,341 DEBUG [org.hibernate.type.StringType] - binding 'TestTitle' to parameter: 1
2007-09-02 10:28:09,341 DEBUG [org.hibernate.type.IntegerType] - binding '1' to parameter: 2
2007-09-02 10:28:09,342 DEBUG [org.hibernate.jdbc.AbstractBatcher] - Executing batch size: 1
2007-09-02 10:28:09,342 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - registering flush end
2007-09-02 10:28:09,343 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - post flush
2007-09-02 10:28:09,343 DEBUG [org.hibernate.impl.SessionImpl] - closing session
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - performing cleanup
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2007-09-02 10:28:09,343 DEBUG [org.hibernate.connection.DriverManagerConnectionProvider] - returning connection to pool, pool size: 1
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction completion
2007-09-02 10:28:09,343 DEBUG [org.hibernate.jdbc.ConnectionManager] - aggressively releasing JDBC connection
2007-09-02 10:28:09,343 DEBUG [org.hibernate.impl.SessionImpl] - after transaction completion
Die Tabelle wird zwar verworfen und neu erstellt, der Datensatz fehlt aber.
Hoffe es kann mir jemand helfen
EDIT by Wildcard
dein gigantischer Classpath ist zu viel für das Board, Umbrüche eingefügt, CodeTags entfernt :wink: