[Hibernate-JIRA] Created: (HHH-3062) Incompleted Collection Returned from Joined Fetch
by Tony Lin (JIRA)
Incompleted Collection Returned from Joined Fetch
-------------------------------------------------
Key: HHH-3062
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3062
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5
Environment: Windows XP SP2, JDK 1.6_03, MySQL 5, Toncat 5.5.25
Reporter: Tony Lin
Attachments: subsets.sql
Executing the following query:
select subset from com.alphait.domain.snomed.object.SubsetImpl as subset join fetch subset.members as members left join fetch members.parent
The members returned after the first subset are not complete, all but the first member are missing.
The classes are attached in HHH-3056. The test data is in the attached file, please load it to a mysql database.
After investigation, the problem seems be in Loader.java's sequentialLoad method:
try {
do {
Object loaded = getRowFromResultSet(
resultSet,
session,
queryParameters,
getLockModes( queryParameters.getLockModes() ),
null,
hydratedObjects,
loadedKeys,
returnProxies
);
if ( result == null ) {
result = loaded;
}
}
while ( keyToRead.equals( loadedKeys[0] ) && resultSet.next() );
}
catch ( SQLException sqle ) {
throw JDBCExceptionHelper.convert(
factory.getSQLExceptionConverter(),
sqle,
"could not perform sequential read of results (forward)",
getSQLString()
);
}
initializeEntitiesAndCollections(
hydratedObjects,
resultSet,
session,
queryParameters.isReadOnly()
);
session.getPersistenceContext().initializeNonLazyCollections();
return result;
It will fetch the next subset also, but only the first member, and the member's parent. These three are hydrated, and resolved when initializeEntitiesAndCollections is called.
This makes the members collection to be freezed, and no member can be added.
We put the following:
key = getKeyFromResultSet(
0,
persisters[0],
null,
resultSet,
session
);
if (!keyToRead.equals(key)) { // we are done, no moving forward
break;
}
before calling getRowFromResultSet(). This temporarily solved the problem for us.
Also this kind of query cannot have order by containing only the members' properties as it will return rows not ordered by Subset's ID. I think the HQL query parser should not permit this.
--
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
17 years, 5 months
[Hibernate-JIRA] Created: (EJB-300) create-drop with c3p0 causes SQLException
by Chris Redekop (JIRA)
create-drop with c3p0 causes SQLException
-----------------------------------------
Key: EJB-300
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-300
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.2.1
Environment: hibernate-entitymanager 3.2.1.ga, c3p0 0.9.0, and postgreSQL 8.1.8 or hsqldb 1.8.7
Reporter: Chris Redekop
Attachments: c3p0Test.tar.gz
In the attached test application, an EntityManagerFactory is created and then closed.
Closing the EMF causes line 801 of org.hibernate.impl.SessionFactoryImpl to call getConnectionProvider().close(), which eventually results in c3p0's PooledDataSource being closed.
Line 808 of org.hibernate.impl.SessionFactoryImpl the calls schemaExport.drop(), which attempts to acquire a connection from the data source and causes the following SQLException.
java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@fced4 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@9505f [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 9505f, idleConnectionTestPeriod -> 100, initialPoolSize -> 10, maxIdleTime -> 100, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@80cac9 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 80cac9, jdbcUrl -> jdbc:hsqldb:., properties -> {user=******, password=******, autocommit=true, release_mode=auto} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> fced4, numHelperThreads -> 3 ] has been closed() -- you can no longer use it.
This exception is swallowed so it does not cause a test error, but it does appear in the console output.
--
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
17 years, 5 months
[Hibernate-JIRA] Created: (HBX-1013) Hibernate giving a field (with maximum 3 characters) with lot of spaces appended to it
by Deepesh Seetharaman (JIRA)
Hibernate giving a field (with maximum 3 characters) with lot of spaces appended to it
--------------------------------------------------------------------------------------
Key: HBX-1013
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1013
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.cr1
Environment: Hibernate 3.2.0.cr4, Oracle 9i
Reporter: Deepesh Seetharaman
Please refer the table structure and the hbm.xml file's content below
Problem: Tempo_id is supposed to be of max-lenght 3, but hibernate gives a String with 3 characters and plenty of space appended. eg : "SLW "
CREATE TABLE EDECO_TEMPO
(
TEMPO_ID CHAR(3 CHAR) NOT NULL,
TEMPO_NAME VARCHAR2(40 CHAR) NOT NULL,
BPMRANGE VARCHAR2(40 CHAR),
TEMPO_DESC VARCHAR2(2000 CHAR)
)
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.wcm.edeco.assetdetails.vo">
<class
name="EdecoTempo"
table="EDECO_TEMPO"
>
<meta attribute="sync-DAO">false</meta>
<id
name="tempoId"
column="TEMPO_ID"
type="java.lang.String"
length="3"
>
<generator class="assigned">
</generator>
</id>
<property
name="tempoName"
column="TEMPO_NAME"
type="java.lang.String"
not-null="false"
length="40"
/>
<property
name="bpmrange"
column="BPMRANGE"
type="java.lang.String"
not-null="false"
length="40"
/>
<property
name="tempoDesc"
column="TEMPO_DESC"
type="java.lang.String"
not-null="false"
/>
</class>
</hibernate-mapping>
--
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
17 years, 5 months