[Hibernate-JIRA] Created: (HSEARCH-362) When using hibernate-search3.1.0 GA, Search throws AlreadyClosedException under certain circumstances
by S Ravi Bhaskar (JIRA)
When using hibernate-search3.1.0 GA, Search throws AlreadyClosedException under certain circumstances
-----------------------------------------------------------------------------------------------------
Key: HSEARCH-362
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-362
Project: Hibernate Search
Issue Type: Bug
Components: directory provider
Affects Versions: 3.1.0.GA
Environment: Hibernate 3.2.6 GA, ant 1.7.1
Reporter: S Ravi Bhaskar
The below code throws an AlreadyClosedException when trying to open the lucene index. Junit test to test it works from eclipse, fails in an ant build.
I suspect it is trying to reuse a handle to the index. Please let me know if you need more information.
I had to bump back my hibernate search version to 3.0.1 GA, and then it started working. I am getting by, but would ideally like to use 3.1.0 GA without this exception. I think it has something to do with Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); VS Search.createFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); in the older version.
String query = "BlahBlahBlah";
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("ItemTitle", new StandardAnalyzer() );
org.apache.lucene.search.Query luceneQuery;
try {
luceneQuery = parser.parse(query);
} catch (ParseException e) {
// TODO Auto-generated catch block
logger.error(String.format("Error parsing search querystring "));
return null;
}
javax.persistence.Query fullTextQuery = createFullTextEntityManager().createFullTextQuery(luceneQuery, klass);
List result = fullTextQuery.getResultList(); // return a list of managed
where createFullTextEntityManager() is
public FullTextEntityManager createFullTextEntityManager() {
return Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager()));
}
--
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
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-3449) Unable to use Oracle stored procedure in a <sql-query>
by RC (JIRA)
Unable to use Oracle stored procedure in a <sql-query>
------------------------------------------------------
Key: HHH-3449
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3449
Project: Hibernate3
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6GA
Oracle 10.2.0.4 (& Oracle JDBC Driver version - 11.1.0.6.0)
Java 1.6.0_06
Reporter: RC
Using a stored procedure to fetch result set.
However, an IllegalAccessException is thrown:
Caused by: org.hibernate.HibernateException: Problem while trying to load or access OracleTypes.CURSOR value
at org.hibernate.dialect.Oracle8iDialect.registerResultSetOutParameter(Oracle8iDialect.java:371)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
....
Caused by: java.lang.IllegalAccessException: Class org.hibernate.dialect.Oracle8iDialect can not access a member of class oracle.jdbc.driver.OracleTypes with modifiers ""
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.Class.newInstance0(Class.java:349)
at java.lang.Class.newInstance(Class.java:308)
at org.hibernate.dialect.Oracle8iDialect.registerResultSetOutParameter(Oracle8iDialect.java:369)
... 35 more
--
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
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-3395) Oracle LONG datatype fetching fails on superclass Criteria query
by Ville Anttonen (JIRA)
Oracle LONG datatype fetching fails on superclass Criteria query
----------------------------------------------------------------
Key: HHH-3395
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3395
Project: Hibernate3
Issue Type: Bug
Environment: Oracle 10
Windows XP
Hibernate 3
Weblogic 9.2
Reporter: Ville Anttonen
I have dao-layer method like this.
public PersistentQuery getPersistentQuery(String userId, long queryId){
....
Criteria criteria = m_session.createCriteria(PersistentQuery.class);
criteria.add(Expression.eq("userId",userId));
criteria.add(Expression.eq("id",new Long(queryId)));
return (PersistentQuery) criteria.uniqueResult();
.....
}
Previous code throws "Stream already closed" exception.
PersistentQuery is abstract class
and it's subclasses contains UserType - field
that wraps Oracle's long varchar field.
I can fix this by creating criteria by subclass
like " Criteria criteria = m_session.createCriteria(PersistentOrganizationQuery.class); ".
We're migrating from ingres -> oracle and in ingres previous implementation worked fine.
--
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
14 years, 9 months
[Hibernate-JIRA] Created: (HHH-3406) IndexOutOfBoundsException when a flush occurs during validation inside a flush
by vincent Larchet (JIRA)
IndexOutOfBoundsException when a flush occurs during validation inside a flush
------------------------------------------------------------------------------
Key: HHH-3406
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3406
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: 3.2.6ga, oracle11g, tomcat 6.0.16, spring 2.5.1, redhat5.2 or windows XP or debian etch
Reporter: vincent Larchet
Say we have entity A:
@Entity
public class A {
[...]
@AssertTrue
public boolean validateSomeCondition(){
//call service S
B=S.loadEntityB()
[.... do some stuff with B...]
}
}
In my hibernate session I modifiy several entities among them A1, A2, A3 (instances of A), then I flush the session that firsts validates A1. Inside A1.validateSomeCondition() I have to call a service that loads some data inside its own transaction, thus when it returns a commit is triggered that is intercepted an hibernate flushes its session, and not only entities bound to this transaction but the WHOLE session (including A2, A3 !!!). Then validation of A1 finishes successfully and A1 is saved to db, but right after that this exception occurs
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:596)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:319)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
[...]
I do not really know if flushing A2,A3 entites inside the 2nd flush is an issue or not (I do not mind actually...), so I suggest this quick fix:
inside ActionQueue method
private void executeActions(List list)
throws HibernateException
{
int size = list.size();
for(int i = 0; i < size; i++)
execute((Executable)list.get(i));
list.clear();
session.getBatcher().executeBatch();
}
replace the "static" int size = list.size(); for(int i = 0; i < size; i++) by an iterator...
thx
vincent
NB: we use OpenSessionInViewFilter
--
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
14 years, 9 months