[Hibernate-JIRA] Created: (HHH-2455) "Could not close a JDBC result set" output very often
by Dirk Feufel (JIRA)
"Could not close a JDBC result set" output very often
-----------------------------------------------------
Key: HHH-2455
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2455
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.2
Reporter: Dirk Feufel
Priority: Minor
If you call this type of code (like the DbTimestampType class does), the AbstractBatcher outputs a warning "Could not close a JDBC result set".
The problem should be that closing the prepared statement internally also closes the associated result sets and the AbstractBatcher still has a reference to this result set.
One possible solution might be to provide an additional method
public void closeStatement(PreparedStatement ps, ResultSet rs);
(as already present for closeQueryStatement) in the AbstractBatcher allowing to close both in the right order.
PreparedStatement ps = null;
try {
ps = session.getBatcher().prepareStatement( timestampSelectString );
ResultSet rs = session.getBatcher().getResultSet( ps );
....
} finally {
if ( ps != null ) {
session.getBatcher().closeStatement( ps );
}
}
--
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
13 years
[Hibernate-JIRA] Created: (HHH-5948) Trying to get a PluralAttributePath from a @MappedSuperclass throws org.hibernate.MappingException: Unknown collection role
by Oliver Ringel (JIRA)
Trying to get a PluralAttributePath from a @MappedSuperclass throws org.hibernate.MappingException: Unknown collection role
----------------------------------------------------------------------------------------------------------------------------
Key: HHH-5948
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5948
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.1, 3.6.0
Reporter: Oliver Ringel
Attachments: testcase-hibernate.tgz
I'm trying to get the PluralAttributePath from a collection defined in a MappedSuperclass
@Entity
public class Person extends PersonBase {
@Basic
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@MappedSuperclass
public abstract class PersonBase {
@Id
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@OneToMany()
private Set<Address> addresses = new HashSet<Address>();
public Set<Address> getAddresses() {
return addresses;
}
public void setAddresses(Set<Address> addresses) {
this.addresses = addresses;
}
}
Executing the following
criteriaQuery = criteriaBuilder.createQuery(Person.class);
root = criteriaQuery.from(Person.class);
Path<?> pathAddresses = root.get("addresses");
throws the exception
org.hibernate.MappingException: Unknown collection role: testcase.hibernate.PersonBase.addresses
at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701)
at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58)
at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:157)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:197)
at testcase.hibernate.HibernateTest.testMappedSuperclassPluralAttribute(HibernateTest.java:53)
--
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
13 years
[Hibernate-JIRA] Created: (HHH-5882) JPA lazy Load problem on many-to-one property getter
by Leo Deng (JIRA)
JPA lazy Load problem on many-to-one property getter
----------------------------------------------------
Key: HHH-5882
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5882
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Environment: Windows 7, JDK 1.6 ,MySQL 5.5
Reporter: Leo Deng
Priority: Critical
Attachments: TestJPA.zip
Hibernate could not work properly when I use lazy load in many-to-one situation.you can run the test case in attachment.
I try to get primary-key property of parent object which get from child object property.Hibernate query the parent object from database by foreign key successfully. But when I try to use org.hibernate.property.Getter Interface to read some property, hibernate return null to me.
My code in attachment can be described as follow:
<1>Test function "TestEagerLoadManyToOne" using Eager load can pass the test. Code logic are:
1)Load Child object from database
2)Get "parentObj" property and test whether "parent_id" field in parent is NULL;
2)Use org.hibernate.property.Getter to get "parent_id" field and test the result.
<2>Test function "TestLazyLoadManyToOne" do exactly same thing just like "TestEagerLoadManyToOne", but the "Child" class change "parentObj" property to lazy load mode. this test function could not pass.
Please fix this issue. It's crucial to my project.
--
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
13 years
[Hibernate-JIRA] Created: (HCANN-9) Unable to reference JPA entity beans in a different package
by Krashan Brahmanjara (JIRA)
Unable to reference JPA entity beans in a different package
-----------------------------------------------------------
Key: HCANN-9
URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-9
Project: Hibernate Commons Annotations
Issue Type: Bug
Environment: Hibernate Annotations 3.4.0.GA in Jboss 5.1.0.GA
Reporter: Krashan Brahmanjara
Problem described in
https://forum.hibernate.org/viewtopic.php?f=1&t=998404
Example
Two classes test.jpa.db1.Card ant test.jpa.db2.Cards are in different packages in the same jar and @ManyToOne fails if deployed on Jboss server
... but it work if these clases are together in the same package.
... it not fails on Weblogic with OpenJpa
Stack trace
09:53:37,609 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=test-services-ear
.ear/test-services-ejb-3.0.alfa-SNAPSHOT.jar#test-services-jpa state=Create
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on test.jpa.db1.Card.podm references an unknown ent
ity: test.jpa.db2.Cards
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:81)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:456)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:438)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:309)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
at org.jbtest.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jbtest.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jbtest.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
Tested workarounds, both doesn't work:
- adding an orm.xml file with entries like:
<entity>test.jpa.db1.Card</entity>
<entity>test.jpa.db2.Cards</entity>
- adding an hibernate extensions to class definition like:
@Entity
@org.hibernate.annotations.Entity
@Table(name = "card")
public class Card implements Serializable {
--
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
13 years