[Hibernate-JIRA] Created: (ANN-430) @ManyToOne results in default outer join eager fetch, should be lazy
by Christian Bauer (JIRA)
@ManyToOne results in default outer join eager fetch, should be lazy
--------------------------------------------------------------------
Key: ANN-430
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-430
Project: Hibernate Annotations
Type: Bug
Components: documentation, binder
Reporter: Christian Bauer
Documentation says:
<sect3>
<title>Association fetching</title>
<para>You have the ability to either eagerly or lazily fetch
associated entities. The <literal>fetch</literal> parameter can be set
to <literal>FetchType.LAZY</literal> or
<literal>FetchType.EAGER</literal>. <literal>EAGER</literal> will try
to use an outer join select to retrieve the associated object, while
<literal>LAZY</literal> is the default and will only trigger a select
when the associated object is accessed for the first time. EJBQL also
has a <literal>fetch</literal> keyword that allows you to override
laziness when doing a particular query. This is very useful to improve
performance and is decided on a use case to use case basis.</para>
</sect3>
However, a simple @ManyToOne without any other attributes results in an eager join outer fetch.
--
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
16 years, 11 months
[Hibernate-JIRA] Created: (HHH-2019) Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
by Dave E Martin (JIRA)
Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
----------------------------------------------------------------------------------
Key: HHH-2019
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019
Project: Hibernate3
Type: Improvement
Environment: hibernate / annotations / hibernate.properties
Reporter: Dave E Martin
Priority: Minor
It may occasionally be desirable to programmatically get rid of or override a property value, this is generally allowed for by the .setProperty method, however:
Once hbm2ddl.auto is set to something, there is no way to unset it, or set it to a value which would be equivalent to its being unset (or its undocumented). There is no remove or unset, or deleteProperty, and also setting it to null does not work.
Due to issues such as HHH-2018, it may be necessary to programmatically 'get rid of' hbm2ddl.auto even if the end user (or some other mechanism) has specified a value for it in an external hibernate.properties file (or other method of setting hibernate properties).
--
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
[Hibernate-JIRA] Created: (HHH-2187) bad query results exposes IllegalArgumentException instead of an HibernateException
by Max Rydahl Andersen (JIRA)
bad query results exposes IllegalArgumentException instead of an HibernateException
-----------------------------------------------------------------------------------
Key: HHH-2187
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2187
Project: Hibernate3
Type: Bug
Components: query-hql
Reporter: Max Rydahl Andersen
s.createQuery("kkk");
results in an IllegalArgumentException being thrown making the exception bubble
through the expected catch HibernateException clauses in e.g. the tools.
Cause is:
public void traverseDepthFirst(AST ast) {
if ( ast == null ) {
throw new IllegalArgumentException( "node to traverse cannot be null!" );
}
visitDepthFirst( ast.getFirstChild() );
}
in NodeTraverser.
java.lang.IllegalArgumentException: node to traverse cannot be null!
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:103)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:309)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:304)
at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:374)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:72)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52)
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-2034) Potential ClassCastException in catch block in NullableType
by Galen Palmer (JIRA)
Potential ClassCastException in catch block in NullableType
-----------------------------------------------------------
Key: HHH-2034
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2034
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.1.3
Environment: Hibernate 3.1.3
Reporter: Galen Palmer
Priority: Minor
It is possible to throw an exception from within the catch block of NullableType.nullSafeSet() since the toString(value) method calls in many cases (e.g. StringType) simply result in a cast of return (String)value. This may mask the underlying problem for the users.
A proposed solution would be to replace the call in the catch blog of toString(value) with a reference to value. For example:
line 87:
log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + re.getMessage() );
and line 91:
log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + se.getMessage() );
This change would prevent the catch block from throwing the exception.
--
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, 3 months
[Hibernate-JIRA] Created: (EJB-242) Eclipse RCP + InputStreamZippedJarVisitor problem
by Michał Kostrzewa (JIRA)
Eclipse RCP + InputStreamZippedJarVisitor problem
-------------------------------------------------
Key: EJB-242
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-242
Project: Hibernate Entity Manager
Type: Bug
Components: EntityManager
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0 GA, postgres (but I guess not relevant here)
Reporter: Michał Kostrzewa
Hi,
Max from user list kindly redirected me to fill a bug here. Here it goes as I described it on list. I didn't attached a test case b/c doing it is non-trivial, maybe you'll just know what is the problem and I provided a patch that works for me. But if test case is needed - I'll do it.
--------------
I'm having problems with bundling hibernate and my ejb model in eclipse RCP application. I managed to solve all classloading problems but one, related to InputStreamZippedJarVisitor class.
Simplifying things I have:
hibernate plugin which registers itself for buddy classloading policy
dbmodel plugin which depends on hibernate and is a buddy of hibernate
application plugin which depends on hibernate and dbmodel and is a buddy of hibernate. This application plugin has hibernate.cfg.xml in self.
When I run this project from eclipse IDE, all is fine except the warning message in logs while creating EntityManager:
2006-10-20 09:07:23 org.hibernate.ejb.packaging.InputStreamZippedJarVisitor doProcessElements
WARNING: Unable to find file (ignored): bundleresource://101
java.io.FileNotFoundException: C:\Documents and Settings\mkostrze\sv-head2\com.pentacomp.dbmodel (Access denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(SecureAction.java:99)
at org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(FileBundleEntry.java:50)
at org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(BundleURLConnection.java:53)
at org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(BundleURLConnection.java:99)
at java.net.URL.openStream(URL.java:1007)
at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33)
at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:215)
at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:253)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:229)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at com.pentacomp.dicom.viewer.ViewerContstants.createEntityManager(ViewerContstants.java:170)
at com.pentacomp.dicom.viewer.DicomViewerMainFrame$InitRepositoriesTask.call(DicomViewerMainFrame.java:146)
I suppose hibernate tries to inspect the model jar for some reason, but in IDE this jar location is resolved to directory containing the plugin.
But things get worse when I export the project into java webstart application. I'm getting NullPointerException instead of warning in the same place. I investigated the source and the problem is here:
protected void doProcessElements() throws IOException {
JarInputStream jis;
try {
jis = new JarInputStream( jarUrl.openStream() );
}
catch (IOException ze) {
log.warn( "Unable to find file (ignored): " + jarUrl, ze );
return;
}
The jarUrl is a bundleresource:// url which resolves to DirZipBundleEntry which in turn returns null in getInputStream(). Thus JarInputStream thows NPE.
Here's what I've tried to solve this:
- configure the dbmodel to be unpacked or packed after install
- tried dbmodel with jar inside or with unpacked classes inside
- set hibernate.archive.autodetection to 'none'. (I did it passing parameters map to createEntityManager method)
- change the hibernate sources and replace IOException with Exception in doProcessElement method. This one worked
I guess most likely I did something wrong to my deploy - any ideas please? But if not, perhaps such a change in code may make hibernate more robust (?)
Hibernate version: 3.2.0 GA
best regards,
Michal Kostrzewa
--
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, 3 months