[Hibernate-JIRA] Created: (HHH-3030) NullPointerException happens in versioning
by John (JIRA)
NullPointerException happens in versioning
------------------------------------------
Key: HHH-3030
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3030
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: any
Reporter: John
Priority: Minor
Here is the stack trace:
java.lang.NullPointerException
at org.hibernate.type.IntegerType.next(IntegerType.java:59)
at org.hibernate.engine.Versioning.increment(Versioning.java:25)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getNextVersion(DefaultFlushEntityEventListener.java:358)
at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:250)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:121)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
......
The code is:
public Object next(Object current, SessionImplementor session) {
return new Integer( ( (Integer) current ).intValue() + 1 );
}
Should there be a null checking for the object "current"?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HHH-3349) SequenceStyleGenerator generates strange IDs for PostgreSQL database
by Adam Wozniak (JIRA)
SequenceStyleGenerator generates strange IDs for PostgreSQL database
--------------------------------------------------------------------
Key: HHH-3349
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3349
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Environment: hibernate-3.2.6.ga, hibernate-annotations-3.3.1.GA, hibernate-entitymanager-3.3.2.GA, hibernate-validator-3.0.0.GA, PostgreSQL 8.3.1 on Windows box. Sun Java 6 (Win32 on Vista 32 bits).
Reporter: Adam Wozniak
Hello
I've got a standalone application using environment:
* PostgreSQL 8.3.1 (Win 32)
* hibernate-3.2.6.ga
* hibernate-annotations-3.3.1.GA
* hibernate-entitymanager-3.3.2.GA
* hibernate-validator-3.0.0.GA
I've got a PostgreSQL database sequence:
CREATE SEQUENCE t_seq
INCREMENT 10
MINVALUE 1
MAXVALUE 999999999999999999
START 11;
My entity:
@Entity
@Table(name = "T")
@org.hibernate.annotations.Entity(dynamicUpdate=true, dynamicInsert=true)
public class T
{
private long id;
@Id
@Column(unique = true, nullable = false, precision = 18, scale = 0)
@GeneratedValue(generator = "t_generator")
@GenericGenerator( name = "t_generator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "sequence_name", value = "T_SEQ")
, @Parameter(name = "increment_size", value = "10")
, @Parameter(name = "optimizer", value = "pooled")
}
)
public long getId()
{
return id;
}
public void setId(long id)
{
this.id = id;
}
}
And my test application to recreate this issue:
for(int i = 0; i < 11; i++)
{
if(i == 0 || i == 10)
System.out.println("Database hit to sequence will be performed.");
T t = new T();
em.persist(t);
}
Reading this Steve Ebersole description ( http://blog.hibernate.org/2082.lace#comments ) I would expect, that I will get the following IDs:
11
12
13
14
15
16
17
18
19
20
21
But Hibernate generates:
101
102
103
104
105
106
107
108
109
110
111
Is it something wrong with my code? Or this is a issue in Hibernate?
Note please, that on the same page ( http://blog.hibernate.org/2082.lace#comments ) other person claims that it doesn't work for his configuration based on PostgreSQL.
You will find my log4j output for my test application on the end of my email.
Regards,
Adam Wozniak
Piece of my log4j output:
2008-06-17 20:20:38,198 [main] DEBUG () SessionImpl: opened session at timestamp: 12137268381
2008-06-17 20:20:38,200 [main] DEBUG () JDBCTransaction: begin
2008-06-17 20:20:38,200 [main] DEBUG () ConnectionManager: opening JDBC connection
2008-06-17 20:20:38,200 [main] DEBUG () BasicResourcePool: trace com.mchange.v2.resourcepool.BasicResourcePool@104a4b6 [managed: 1, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@b206e9)
2008-06-17 20:20:38,202 [main] DEBUG () JDBCTransaction: current autocommit status: true
2008-06-17 20:20:38,202 [main] DEBUG () JDBCTransaction: disabling autocommit
2008-06-17 20:20:38,202 [main] DEBUG () JDBCContext: after transaction begin
Database hit to sequence will be performed.
2008-06-17 20:20:39,467 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,469 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,469 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,472 [main] DEBUG () AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-06-17 20:20:39,479 [main] DEBUG () AbstractBatcher:
select
nextval ('T_SEQ')
Hibernate:
select
nextval ('T_SEQ')
2008-06-17 20:20:39,480 [main] DEBUG () AbstractBatcher: preparing statement
2008-06-17 20:20:39,489 [main] DEBUG () GooGooStatementCache: cxnStmtMgr.statementSet( org.postgresql.jdbc4.Jdbc4Connection@1df3082 ).size(): 1
2008-06-17 20:20:39,489 [main] DEBUG () GooGooStatementCache: checkoutStatement: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 1; checked out: 1; num connections: 1; num keys: 1
2008-06-17 20:20:39,506 [main] DEBUG () SequenceStructure$1: Sequence identifier generated: 11
2008-06-17 20:20:39,506 [main] DEBUG () AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-06-17 20:20:39,507 [main] DEBUG () AbstractBatcher: closing statement
2008-06-17 20:20:39,507 [main] DEBUG () GooGooStatementCache: checkinStatement(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 1; checked out: 0; num connections: 1; num keys: 1
2008-06-17 20:20:39,508 [main] DEBUG () AbstractSaveEventListener: generated identifier: 101, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,513 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#101]
2008-06-17 20:20:39,530 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,530 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,530 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,530 [main] DEBUG () AbstractSaveEventListener: generated identifier: 102, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,531 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#102]
2008-06-17 20:20:39,531 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,531 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,531 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,532 [main] DEBUG () AbstractSaveEventListener: generated identifier: 103, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,532 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#103]
2008-06-17 20:20:39,533 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,533 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,533 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,533 [main] DEBUG () AbstractSaveEventListener: generated identifier: 104, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,534 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#104]
2008-06-17 20:20:39,534 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,534 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,534 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,534 [main] DEBUG () AbstractSaveEventListener: generated identifier: 105, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,535 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#105]
2008-06-17 20:20:39,535 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,535 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,535 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,536 [main] DEBUG () AbstractSaveEventListener: generated identifier: 106, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,536 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#106]
2008-06-17 20:20:39,537 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,537 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,537 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,537 [main] DEBUG () AbstractSaveEventListener: generated identifier: 107, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,537 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#107]
2008-06-17 20:20:39,538 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,538 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,538 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,538 [main] DEBUG () AbstractSaveEventListener: generated identifier: 108, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,539 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#108]
2008-06-17 20:20:39,539 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,539 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,539 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,539 [main] DEBUG () AbstractSaveEventListener: generated identifier: 109, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,540 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#109]
2008-06-17 20:20:39,541 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:39,541 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:39,541 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:39,541 [main] DEBUG () AbstractSaveEventListener: generated identifier: 110, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:39,541 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#110]
Database hit to sequence will be performed.
2008-06-17 20:20:40,912 [main] DEBUG () IdentifierValue: id unsaved-value: 0
2008-06-17 20:20:40,912 [main] DEBUG () AbstractSaveEventListener: transient instance of: net.cellbell.model.T
2008-06-17 20:20:40,913 [main] DEBUG () DefaultPersistEventListener: saving transient instance
2008-06-17 20:20:40,913 [main] DEBUG () AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-06-17 20:20:40,913 [main] DEBUG () AbstractBatcher:
select
nextval ('T_SEQ')
Hibernate:
select
nextval ('T_SEQ')
2008-06-17 20:20:40,914 [main] DEBUG () AbstractBatcher: preparing statement
2008-06-17 20:20:40,914 [main] DEBUG () GooGooStatementCache: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache ----> CACHE HIT
2008-06-17 20:20:40,914 [main] DEBUG () GooGooStatementCache: checkoutStatement: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 1; checked out: 1; num connections: 1; num keys: 1
2008-06-17 20:20:40,917 [main] DEBUG () SequenceStructure$1: Sequence identifier generated: 21
2008-06-17 20:20:40,917 [main] DEBUG () AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-06-17 20:20:40,917 [main] DEBUG () AbstractBatcher: closing statement
2008-06-17 20:20:40,917 [main] DEBUG () GooGooStatementCache: checkinStatement(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 1; checked out: 0; num connections: 1; num keys: 1
2008-06-17 20:20:40,918 [main] DEBUG () AbstractSaveEventListener: generated identifier: 111, using strategy: org.hibernate.id.enhanced.SequenceStyleGenerator
2008-06-17 20:20:40,918 [main] DEBUG () AbstractSaveEventListener: saving [net.cellbell.model.T#111]
2008-06-17 20:20:40,919 [main] DEBUG () JDBCTransaction: commit
2008-06-17 20:20:40,919 [main] DEBUG () SessionImpl: automatically flushing session
2008-06-17 20:20:40,922 [main] DEBUG () AbstractFlushingEventListener: flushing session
2008-06-17 20:20:40,923 [main] DEBUG () AbstractFlushingEventListener: processing flush-time cascades
2008-06-17 20:20:40,924 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,925 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,925 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,925 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,926 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,927 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,927 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,927 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,927 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,929 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,929 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,929 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,929 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,929 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,930 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,930 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,930 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,930 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,931 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,932 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,932 [main] DEBUG () Cascade: processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,932 [main] DEBUG () Cascade: done processing cascade ACTION_PERSIST_ON_FLUSH for: net.cellbell.model.T
2008-06-17 20:20:40,932 [main] DEBUG () AbstractFlushingEventListener: dirty checking collections
2008-06-17 20:20:40,933 [main] DEBUG () AbstractFlushingEventListener: Flushing entities and processing referenced collections
2008-06-17 20:20:40,939 [main] DEBUG () AbstractFlushingEventListener: Processing unreferenced collections
2008-06-17 20:20:40,939 [main] DEBUG () AbstractFlushingEventListener: Scheduling collection removes/(re)creates/updates
2008-06-17 20:20:40,940 [main] DEBUG () AbstractFlushingEventListener: Flushed: 11 insertions, 0 updates, 0 deletions to 11 objects
2008-06-17 20:20:40,940 [main] DEBUG () AbstractFlushingEventListener: Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2008-06-17 20:20:40,942 [main] DEBUG () Printer: listing entities:
2008-06-17 20:20:40,942 [main] DEBUG () Printer: net.cellbell.model.T{id=105}
2008-06-17 20:20:40,943 [main] DEBUG () Printer: net.cellbell.model.T{id=104}
2008-06-17 20:20:40,943 [main] DEBUG () Printer: net.cellbell.model.T{id=107}
2008-06-17 20:20:40,943 [main] DEBUG () Printer: net.cellbell.model.T{id=106}
2008-06-17 20:20:40,945 [main] DEBUG () Printer: net.cellbell.model.T{id=101}
2008-06-17 20:20:40,945 [main] DEBUG () Printer: net.cellbell.model.T{id=103}
2008-06-17 20:20:40,945 [main] DEBUG () Printer: net.cellbell.model.T{id=102}
2008-06-17 20:20:40,945 [main] DEBUG () Printer: net.cellbell.model.T{id=109}
2008-06-17 20:20:40,945 [main] DEBUG () Printer: net.cellbell.model.T{id=108}
2008-06-17 20:20:40,946 [main] DEBUG () Printer: net.cellbell.model.T{id=111}
2008-06-17 20:20:40,946 [main] DEBUG () Printer: net.cellbell.model.T{id=110}
2008-06-17 20:20:40,946 [main] DEBUG () AbstractFlushingEventListener: executing flush
2008-06-17 20:20:40,947 [main] DEBUG () ConnectionManager: registering flush begin
2008-06-17 20:20:40,951 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#101]
2008-06-17 20:20:40,956 [main] DEBUG () AbstractBatcher: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-06-17 20:20:40,957 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,957 [main] DEBUG () AbstractBatcher: preparing statement
2008-06-17 20:20:40,957 [main] DEBUG () GooGooStatementCache: cxnStmtMgr.statementSet( org.postgresql.jdbc4.Jdbc4Connection@1df3082 ).size(): 2
2008-06-17 20:20:40,959 [main] DEBUG () GooGooStatementCache: checkoutStatement: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 2; checked out: 1; num connections: 1; num keys: 2
2008-06-17 20:20:40,959 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#101]
2008-06-17 20:20:40,960 [main] DEBUG () NullableType: binding '101' to parameter: 1
2008-06-17 20:20:40,964 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#102]
2008-06-17 20:20:40,965 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,965 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,965 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#102]
2008-06-17 20:20:40,967 [main] DEBUG () NullableType: binding '102' to parameter: 1
2008-06-17 20:20:40,967 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#103]
2008-06-17 20:20:40,967 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,968 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,968 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#103]
2008-06-17 20:20:40,970 [main] DEBUG () NullableType: binding '103' to parameter: 1
2008-06-17 20:20:40,970 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#104]
2008-06-17 20:20:40,970 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,970 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,971 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#104]
2008-06-17 20:20:40,971 [main] DEBUG () NullableType: binding '104' to parameter: 1
2008-06-17 20:20:40,971 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#105]
2008-06-17 20:20:40,972 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,972 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,972 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#105]
2008-06-17 20:20:40,973 [main] DEBUG () NullableType: binding '105' to parameter: 1
2008-06-17 20:20:40,973 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#106]
2008-06-17 20:20:40,973 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,975 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,976 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#106]
2008-06-17 20:20:40,977 [main] DEBUG () NullableType: binding '106' to parameter: 1
2008-06-17 20:20:40,977 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#107]
2008-06-17 20:20:40,977 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,978 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,979 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#107]
2008-06-17 20:20:40,979 [main] DEBUG () NullableType: binding '107' to parameter: 1
2008-06-17 20:20:40,979 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#108]
2008-06-17 20:20:40,980 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,980 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,980 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#108]
2008-06-17 20:20:40,981 [main] DEBUG () NullableType: binding '108' to parameter: 1
2008-06-17 20:20:40,981 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#109]
2008-06-17 20:20:40,982 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,982 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,982 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#109]
2008-06-17 20:20:40,983 [main] DEBUG () NullableType: binding '109' to parameter: 1
2008-06-17 20:20:40,983 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#110]
2008-06-17 20:20:40,983 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,983 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,984 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#110]
2008-06-17 20:20:40,984 [main] DEBUG () NullableType: binding '110' to parameter: 1
2008-06-17 20:20:40,984 [main] DEBUG () AbstractEntityPersister: Inserting entity: [net.cellbell.model.T#111]
2008-06-17 20:20:40,984 [main] DEBUG () AbstractBatcher: reusing prepared statement
2008-06-17 20:20:40,985 [main] DEBUG () AbstractBatcher:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
Hibernate:
/* insert net.cellbell.model.T
*/ insert
into
T
(id)
values
(?)
2008-06-17 20:20:40,985 [main] DEBUG () AbstractEntityPersister: Dehydrating entity: [net.cellbell.model.T#111]
2008-06-17 20:20:40,986 [main] DEBUG () NullableType: binding '111' to parameter: 1
2008-06-17 20:20:40,986 [main] DEBUG () BatchingBatcher: Executing batch size: 11
2008-06-17 20:20:40,995 [main] DEBUG () AbstractBatcher: about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-06-17 20:20:40,995 [main] DEBUG () AbstractBatcher: closing statement
2008-06-17 20:20:40,995 [main] DEBUG () GooGooStatementCache: checkinStatement(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 2; checked out: 0; num connections: 1; num keys: 2
2008-06-17 20:20:40,996 [main] DEBUG () ConnectionManager: registering flush end
2008-06-17 20:20:40,996 [main] DEBUG () AbstractFlushingEventListener: post flush
2008-06-17 20:20:40,996 [main] DEBUG () JDBCContext: before transaction completion
2008-06-17 20:20:40,996 [main] DEBUG () SessionImpl: before transaction completion
2008-06-17 20:20:41,044 [main] DEBUG () JDBCTransaction: re-enabling autocommit
2008-06-17 20:20:41,045 [main] DEBUG () JDBCTransaction: committed JDBC Connection
2008-06-17 20:20:41,045 [main] DEBUG () JDBCContext: after transaction completion
2008-06-17 20:20:41,045 [main] DEBUG () ConnectionManager: aggressively releasing JDBC connection
2008-06-17 20:20:41,045 [main] DEBUG () ConnectionManager: releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2008-06-17 20:20:41,050 [main] DEBUG () GooGooStatementCache: checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 2; checked out: 0; num connections: 1; num keys: 2
2008-06-17 20:20:41,051 [main] DEBUG () BasicResourcePool: trace com.mchange.v2.resourcepool.BasicResourcePool@104a4b6 [managed: 1, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@b206e9)
2008-06-17 20:20:41,051 [main] DEBUG () SessionImpl: after transaction completion
2008-06-17 20:20:41,051 [main] DEBUG () PersistenceUtil: Closing EntityManager: org.hibernate.ejb.EntityManagerImpl@13c8540...
2008-06-17 20:20:41,052 [main] DEBUG () SessionImpl: closing session
2008-06-17 20:20:41,052 [main] DEBUG () ConnectionManager: connection already null in cleanup : no action
2008-06-17 20:20:41,051 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] DEBUG () GooGooStatementCache: checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 2; checked out: 0; num connections: 1; num keys: 2
2008-06-17 20:20:41,055 [main] DEBUG () PersistenceUtil: EntityManager: org.hibernate.ejb.EntityManagerImpl@13c8540 closed.
2008-06-17 20:20:41,055 [main] INFO () PersistenceUtil: Closing main EntityManagerFactory...
2008-06-17 20:20:41,056 [main] INFO () SessionFactoryImpl: closing
2008-06-17 20:20:41,058 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] DEBUG () ThreadPoolAsynchronousRunner$PoolThread: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main] interrupted. Shutting down.
2008-06-17 20:20:41,058 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] DEBUG () ThreadPoolAsynchronousRunner$PoolThread: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main] interrupted. Shutting down.
2008-06-17 20:20:41,058 [main] DEBUG () ActiveManagementCoordinator: MBean: com.mchange.v2.c3p0:type=PooledDataSource[1hge11v7u163uw8e90ilzp|405f6] unregistered.
2008-06-17 20:20:41,059 [main] DEBUG () ActiveManagementCoordinator: C3P0Registry mbean unregistered.
2008-06-17 20:20:41,060 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] DEBUG () ThreadPoolAsynchronousRunner$PoolThread: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] interrupted. Shutting down.
2008-06-17 20:20:41,062 [main] DEBUG () AbstractPoolBackedDataSource: com.mchange.v2.c3p0.PoolBackedDataSource@405f6 has been closed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HHH-3798) failure to lazy load a manyToOne and oneToMany mapped entity
by Ronald Kurz (JIRA)
failure to lazy load a manyToOne and oneToMany mapped entity
------------------------------------------------------------
Key: HHH-3798
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3798
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1, 3.5
Environment: hibernate annotations test case, maven profile hsqldb, svn rev 16079
hibernate-core 3.3.1.GA, JBoss 4.2.3, SQLServer 2000
Reporter: Ronald Kurz
Attachments: test-case.tar.gz
Following situtation: an entity Data has Revision entities (oneToMany). Each Revision entity belongs to a Data entity. The Data entity has one manyToOne mapping to the current Revision. The mappings from Data to Revision are all lazy.
When loading a Data entity, which has two Revisions, the Revision entity which is also mapped as manyToOne (the current Revision for that Data entity), does not get loaded. It will be an uninitialized proxy, which is also resistent to Hibernate.initialize(<Data>.revision). The same proxy is also in the oneToMany mapped list.
@Entity
public class Data {
@Id @GeneratedValue
public int id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "revisionId")
public Revision revision;
@OneToMany(mappedBy = "data")
public List<Revision> revisions = new ArrayList<Revision>();
}
@Entity
public class Revision {
@Id @GeneratedValue
public int id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "dataId", nullable = false, updatable = false)
public Data data;
public Integer number;
}
The test case is written for the hibernate-annotations project (simply because I never wrote a mapping using xml)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HHH-3476) Generation of invalid SQL by HQL Delete
by Daniel Nunes (JIRA)
Generation of invalid SQL by HQL Delete
---------------------------------------
Key: HHH-3476
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3476
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6, 3.1.3
Environment: MS SQL Server 2000, Hibernate 3.1.3 and Hibernate 3.2.6 GA
Reporter: Daniel Nunes
Attachments: grupo.rar, hibernate.cfg.xml
Hibernate generates invalid DML command for HQL Delete statement.
When doing:
Integer vals[] = {1,3};
Query q = ugDAO.createQuery("delete UsuarioGrupo usuariorGrp"+
" where usuariorGrp.usuario.idusuario = :idUsr"+
" and usuariorGrp.grupo.idgrupo in (:idsGrupo)"+
" and usuariorGrp.grupo.cxpostal.idcxpostal = :idCx");
q.setParameterList("idsGrupo", vals);
q.setInteger("idUsr", 77);
q.setInteger("idCx", 2);
It generates an SQL like this:
Hibernate: delete from vanpix.dbo.usuario_grupo, vanpix.dbo.grupo grupo1_ where idusuario=? and (idgrupo in (? , ?)) and idcxpostal=?
17:26:22,406 DEBUG IntegerType:133 - binding '77' to parameter: 1
17:26:22,406 DEBUG IntegerType:133 - binding '1' to parameter: 2
17:26:22,406 DEBUG IntegerType:133 - binding '3' to parameter: 3
17:26:22,406 DEBUG IntegerType:133 - binding '2' to parameter: 4
17:26:22,453 WARN JDBCExceptionReporter:77 - SQL Error: 170, SQLState: 37000
17:26:22,453 ERROR JDBCExceptionReporter:78 - Line 1: Incorrect syntax near ','.
Throwing the exception:
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute update query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:84)
at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:396)
at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:259)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1141)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94)
at com.pix.tests.HibernateTests.main(HibernateTests.java:37)
Caused by: java.sql.SQLException: Line 1: Incorrect syntax near ','.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75)
... 5 more
The HBMs are in the attachment.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HSEARCH-320) Hibernate Search conflicts with Spring's class path scanning
by Paul Middelkoop (JIRA)
Hibernate Search conflicts with Spring's class path scanning
------------------------------------------------------------
Key: HSEARCH-320
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-320
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.0.GA, 3.1.0.CR1
Reporter: Paul Middelkoop
Hibernate Search conflicts with Spring's class path scanning. When Hibernate Search is on the classpath Spring throws an exception while reading annotation metadata.
3.1.0 Beta1 and 3.0.x versions had no problems.
Stacktrace:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 50432
at org.springframework.asm.ClassReader.readUTF8(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.getAnnotationMetadata(SimpleMetadataReader.java:55)
at org.springframework.core.type.filter.AnnotationTypeFilter.matchSelf(AnnotationTypeFilter.java:68)
at org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter.match(AbstractTypeHierarchyTraversingFilter.java:55)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:224)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:182)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:201)
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:85)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 9 months