[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: (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
[Hibernate-JIRA] Created: (HHH-2907) ability to apply 'generation strategy' to generated properties
by Steve Ebersole (JIRA)
ability to apply 'generation strategy' to generated properties
--------------------------------------------------------------
Key: HHH-2907
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2907
Project: Hibernate3
Issue Type: New Feature
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Priority: Minor
Fix For: 3.3
Currently, the support for generated properties allows only for db-generated values (ala triggers etc). Would be great to allow the user to provide a seperate (optional) strategy for generating the generated values.
It would be nice to have a generic solution, which we can build on top of for the more common use cases. Also, we may need to use a name other than 'generated' in the annotations to avoid conflicts with the current @Generated annotation; for now lets use the term @Dynamic.
Consider mapping a 'created timestamp' column. Currently, provided we are using a trigger, that would look like:
@Generated(INSERT) Date created;
The strategy here (^^) is implicitly 'db', as the db is taking care of the generation. In the most generic form, that could be written as:
@Dynamic(time=INSERT,strategy=DB) Date created;
Additionally, since this is such a common case, also allow this:
@CreationTimestamp Date created;
The final form would also allow the definition of strategies. As an example, consider:
@CreationTimestamp(strategy=NOW) Date created;
Here we are not relying on the db to generate the value, but are explicitly telling Hibernate to do it (basically 'use the current timestamp to generate a value here whenever we do an insert').
--
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-2434) No standard way to calculate date intervals in HQL
by Don Smith (JIRA)
No standard way to calculate date intervals in HQL
--------------------------------------------------
Key: HHH-2434
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2434
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Environment: All
Reporter: Don Smith
Priority: Minor
Date interval calculation is supported differently on different database platforms. Some allow direct arithmetic on columns, i.e. enddate - startdate. Some require functions, datediff(), timestampdiff(), etc. This causes cross-platform issues. For instance, an application I work on has to figure out the dialect that's in use (out of the four we currently support) and create the HQL string differently for each platform. This is undesirable, since we use Hibernate to enable platform neutrality; our installer asks which database the customer wants to deploy to, and sets the dialect. We'd like our codebase to be free of dialect-specific code.
I propose a standard solution for this, either direct date arithmetic, or a function defintion that is ported across dialects. Timestampdiff seems to be a fairly standard function, although DB2 has different syntax than MySQL and Derby. I've seen hints that timestampdiff is part of the ANSI SQL standard, but do not have access to the documents to determine if that is the case.
--
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-3348) loading context
by benjamin Leroux (JIRA)
loading context
---------------
Key: HHH-3348
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3348
Project: Hibernate3
Issue Type: New Feature
Affects Versions: 4.x
Reporter: benjamin Leroux
Priority: Minor
this proposal is for creating a loading context into hibernate
Let me explain:
On an application, we often hesitating between the two major strategies of loading (eager or lazy). But for some reason there has no good choice. In fact, it depends on the context.
So we do lazy loading and redefine some method with new request with some "join". In fact, it lead to complexity and decrease managability of the application.
So my idea is to allow the definition of a context (like transactional context) where we we can put the loading strategie to adopt.
with annotation it could be very easy to define such context. Let see this exemple :
Avec les annotations, cela pourrait conduire à une ecriture de ce style :
@LoadingStrategie (type=eager from="Car" get={"driver"})
public List<Car> getAllCarForDriving(){
// Some fonctions
}
@LoadingStrategie (type=eager from="Car" get={"driver","passengers"})
public List<Car> getAllCarForTravelling(){
// Some fonctions
}
In the method getAllCarForDriving when we call a hql request on car it automaticaly get driver but in the method getAllCarForTravelling passengers and the driver is loaded.
--
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