[Hibernate-JIRA] Created: (HHH-2584) PersistentMap.remove() incorrect on uninitialized, non-extra-lazy map
by Daniel Wellman (JIRA)
PersistentMap.remove() incorrect on uninitialized, non-extra-lazy map
---------------------------------------------------------------------
Key: HHH-2584
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2584
Project: Hibernate3
Issue Type: Patch
Components: core
Affects Versions: 3.2.3, 3.2.2, 3.2.1
Environment: Hibernate 3.2.3 ga, MySQL 5.0.24a, for Win32
Reporter: Daniel Wellman
Attachments: persistentmap_remove.patch
This problem is nearly identical to HHH-2476: PersistentMap.put() incorrect on uninitialized, non-extra-lazy map. remove() has the same problem. See also issue HHH-2142.
The write up for HHH-2476 was so concise that I will transform it here, substituting remove() for put().
---
Essentially, an uninitialized PersistentMap loses the first remove() into it if defined as non-extra-lazy.
The underlying cause is the code in PersistentMap#remove() which attempts to readElementByIndex(). In the case of non-extra-lazy, readElementByIndex() returns the UNKNOWN marker object which is supposed to be used to signal that the delegate map is now initialized and to remove the element directly from the map. Long story short, PersistentMap#remove() does not properly check the return value from readElementByIndex() and react accordingly.
--
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, 5 months
[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, 5 months
[Hibernate-JIRA] Created: (HHH-4773) unit tests fail cos db2 doesn't allow primary key column nullable
by Strong Liu (JIRA)
unit tests fail cos db2 doesn't allow primary key column nullable
-----------------------------------------------------------------
Key: HHH-4773
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4773
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2
Environment: db2
Reporter: Strong Liu
org.hibernate.search.test.embedded.EmbeddedTest.testIndexedEmbeddedAndCollections
Column 'CUST_NAME' is part of a primary key constraint and cannot be null.
org.hibernate.test.annotations.target.TargetTest.testTargetOnMapKey
19:47:29,104 DEBUG SchemaExport:377 -
create table Brand_LuggageImpl (
Brand_id bigint not null,
luggagesBySize_id bigint not null,
name varchar(255),
primary key (Brand_id, name)
)
19:47:29,129 ERROR SchemaExport:348 - Unsuccessful: create table Brand_LuggageImpl (Brand_id bigint not null, luggagesBySize_id bigint not null, name varchar(255), primary key (Brand_id, name))
org.hibernate.test.annotations.collectionelement.indexedCollection.IndexedCollectionOfElementsTest.testIndexedCollectionOfElements
create table contact (
n_key_person integer not null,
name varchar(255),
n_key_contact bigint,
primary key (n_key_contact)
)
19:45:24,074 ERROR SchemaExport:348 - Unsuccessful: create table contact (n_key_person integer not null, name varchar(255), n_key_contact bigint, primary key (n_key_contact))
19:45:24,073 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: N_KEY_CONTACT
org.hibernate.test.annotations.any.AnyTest.testManyToAnyWithMap
19:43:44,418 DEBUG SchemaExport:377 -
alter table map_properties
add constraint FKF2788BF69AF4A643
foreign key (map_id)
references property_map
19:43:44,420 ERROR SchemaExport:348 - Unsuccessful: alter table map_properties add constraint FKF2788BF69AF4A643 foreign key (map_id) references property_map
19:43:44,420 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: HIBBR330.MAP_PROPERTIES
org.hibernate.test.annotations.identifiercollection.IdentifierCollectionTest.testIdBag
19:44:05,449 DEBUG SchemaExport:377 -
create table PASSPORT_STAMP (
Passport_passport_id bigint not null,
stamps_id bigint not null,
COLLECTION_ID bigint,
primary key (COLLECTION_ID)
)
19:44:05,494 ERROR SchemaExport:348 - Unsuccessful: create table PASSPORT_STAMP (Passport_passport_id bigint not null, stamps_id bigint not null, COLLECTION_ID bigint, primary key (COLLECTION_ID))
19:44:05,493 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: COLLECTION_ID
19:44:05,494 DEBUG SchemaExport:377 -
create table PASSPORT_VISASTAMP (
Passport_passport_id bigint not null,
visaStamp_id bigint not null,
COLLECTION_ID bigint,
primary key (COLLECTION_ID)
)
19:44:05,526 ERROR SchemaExport:348 - Unsuccessful: create table PASSPORT_VISASTAMP (Passport_passport_id bigint not null, visaStamp_id bigint not null, COLLECTION_ID bigint, primary key (COLLECTION_ID))
19:44:05,525 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: COLLECTION_ID
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testRealMap
19:46:31,064 DEBUG SchemaExport:377 -
create table Atmosphere_Gas (
Atmosphere_id integer not null,
gases_id integer not null,
gas_name varchar(255),
primary key (Atmosphere_id, gas_name)
)
19:46:31,093 ERROR SchemaExport:348 - Unsuccessful: create table Atmosphere_Gas (Atmosphere_id integer not null, gases_id integer not null, gas_name varchar(255), primary key (Atmosphere_id, gas_name))
19:46:31,094 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: GAS_NAME
org.hibernate.test.annotations.collectionelement.CollectionElementTest
19:45:09,816 DEBUG SchemaExport:377 -
create table Matrix_values (
Matrix_id integer not null,
element float,
mapkey integer,
primary key (Matrix_id, mapkey)
)
19:45:09,844 ERROR SchemaExport:348 - Unsuccessful: create table Matrix_values (Matrix_id integer not null, element float, mapkey integer, primary key (Matrix_id, mapkey))
19:45:09,845 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: MAPKEY
19:45:09,844 DEBUG SchemaExport:377 -
create table ScorePerNickName (
BoyId integer not null,
fld_score integer,
mapkey varchar(255),
primary key (BoyId, mapkey)
)
19:45:09,872 ERROR SchemaExport:348 - Unsuccessful: create table ScorePerNickName (BoyId integer not null, fld_score integer, mapkey varchar(255), primary key (BoyId, mapkey))
19:45:09,871 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: MAPKEY
19:45:09,871 DEBUG SchemaExport:377 -
create table TestCourse (
testCourseId bigint generated by default as identity,
primary key (testCourseId)
)
19:45:09,920 DEBUG SchemaExport:377 -
create table TestCourse_variations (
TestCourse_testCourseId bigint not null,
element varchar(255),
language_code varchar(255),
primary key (TestCourse_testCourseId, language_code)
)
19:45:09,944 ERROR SchemaExport:348 - Unsuccessful: create table TestCourse_variations (TestCourse_testCourseId bigint not null, element varchar(255), language_code varchar(255), primary key (TestCourse_testCourseId, language_code))
19:45:09,946 ERROR SchemaExport:349 - DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: LANGUAGE_CODE
--
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, 5 months