[Hibernate-JIRA] Created: (ANN-495) Provide access to IndexWriter.optimize()
by Emmanuel Bernard (JIRA)
Provide access to IndexWriter.optimize()
----------------------------------------
Key: ANN-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-495
Project: Hibernate Annotations
Type: New Feature
Components: lucene
Reporter: Emmanuel Bernard
Fix For: 3.3.0.Alpha1
The problem is not solved "automatically" yet. But here is the reason why.
First of all, the elements are properly deleted, and the index file reflect that as soon as IndexReader.close() is called (which is done by Hibernate Search). However, the files containing the document data are not cleaned.
Basically, to physically delete the elements, you need to optimize() your index, this operation typically takes more time and doing it for every single delete is not appropriate.
I see 4 solutions:
1. let the user access the Directory and call the indexWriter.optimize() method. It works today but it sucks.
2. add an FullTextSession.optimize(Class) method, and the application is responsible for the method trigger. This is the easy solution but put more work on the user. And I'm not happy to push a maintenance API to the Session. Esp since this is more of a SessionFactory like API.
2bis. publish this API through JMX
3. optimize every N operations. It is trivial to add a counter per DirectoryProvider and trigger the optimization. N should be customizable
4. optimize every N seconds. either by setting a timer in an additional thread or wait for the next operation and compare the timestamp
2(bis or not) and 3 are my favorites. It's really 2 or 3 hours of work. If someone is interested, ping me.
--
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
18 years, 10 months
[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
18 years, 11 months
[Hibernate-JIRA] Created: (HBX-819) NullPointerException in simple case with one configuration file and two console configurations
by Francois Granade (JIRA)
NullPointerException in simple case with one configuration file and two console configurations
----------------------------------------------------------------------------------------------
Key: HBX-819
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-819
Project: Hibernate Tools
Type: Bug
Components: consoleconfiguration
Versions: 3.2beta8
Environment: macos, hsqldb
Reporter: Francois Granade
Priority: Minor
I'm having an NullPointerException (See the stack below), I'm not really able to understand what triggers it (it is not completely reproducible, it seems).
My setup is very simple: just one Java project, one hibernate configuration file, two console configurations, nothing else. The only thing that's a little special, is that one of the console configuration is invalid (no driver jar file defined).
I'll try to describe it as precisely as possible:
- I have a very simple HSQLDB server, just out-of-the box. I have created only one table with: "create table x (a varchar(255), b int)".
- I created an Hibernate configuration file for the HSQLDB database using "File > New > Others", "Hibernate > Hibernate configuration file"; I specified "create a console configuration", and I gave a name to the Console Configuration, but I didn't set any other property (in particular, I did not specify the .jar file for hsqldb: so it's not a correctly defined console configuration)
- Then I created a second console configuration; That time, in the 'classpath' section at the bottom, I selected 'add external jar' and added my 'hsqldb.jar'.
- I can now open the HSQL DB correctly in the Hibernate Configuration view, with this second console configuration (the first one is doing an error, which is normal).
- now, time to time, when I right-click on the definition of my table ('X"), and select "HQL Editor", I sometimes get the NullPointerException (but not always).
here's the stack trace:
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
at java.util.TreeMap.compare(TreeMap.java:1093)
at java.util.TreeMap.getEntry(TreeMap.java:347)
at java.util.TreeMap.get(TreeMap.java:265)
at org.hibernate.console.KnownConfigurations.find(KnownConfigurations.java:225)
at org.hibernate.eclipse.console.AbstractQueryEditor.getConsoleConfiguration(AbstractQueryEditor.java:51)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.updateText(DynamicSQLPreviewView.java:137)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.setCurrentEditor(DynamicSQLPreviewView.java:130)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.hookIntoEditor(DynamicSQLPreviewView.java:114)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.access$2(DynamicSQLPreviewView.java:107)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView$1.partBroughtToTop(DynamicSQLPreviewView.java:92)
at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:83)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53)
at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(PartListenerList2.java:81)
at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:90)
at org.eclipse.ui.internal.WWinPartService$1.partBroughtToTop(WWinPartService.java:40)
at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:
--
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
19 years
[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
19 years, 1 month
[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
19 years, 1 month