[Hibernate-JIRA] Created: (HHH-4977) org.hibernate.test.hql.ASTParserLoadingTest error running testOneToManyFilter with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testOneToManyFilter with Ingres
-----------------------------------------------------------------------------------------
Key: HHH-4977
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4977
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
Error reported executing org.hibernate.test.hql.ASTParserLoadingTest testOneToManyFilter with an Ingres exception
{noformat}
<error message="could not execute query" type="org.hibernate.exception.SQLGrammarException">org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.listFilter(SessionImpl.java:1614)
at org.hibernate.impl.CollectionFilterImpl.list(CollectionFilterImpl.java:74)
at org.hibernate.test.hql.ASTParserLoadingTest.testOneToManyFilter(ASTParserLoadingTest.java:1653)
Caused by: com.ingres.gcf.util.SqlEx: A <column reference> contained a <qualifier> 'order0_'
which did not correspond to any of the <table reference>s
within whose scope the <column reference> appeared.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 38 more
</error>
{noformat}
The SQL query that is produced references order0_ in the WHERE clause of the subselect.
{noformat}
select
order0_.customerId as customerId35_,
order0_.orderNumber as orderNum2_35_,
order0_.orderDate as orderDate35_,
( select
sum(li.quantity*p.cost)
from
LineItem li,
Product p
where
li.productId = p.productId
and li.customerId = order0_.customerId
and li.orderNumber = order0_.orderNumber ) as formula1_
from
CustomerOrder order0_
where
order0_.customerId = ?
{noformat}
Once the scoping error is removed a more fundamental error is exposed "Sub-selects are not supported within select target lists."
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-4976) org.hibernate.test.hql.ASTParserLoadingTest error running testImplicitPolymorphism with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testImplicitPolymorphism with Ingres
----------------------------------------------------------------------------------------------
Key: HHH-4976
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4976
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
Error reported executing org.hibernate.test.hql.ASTParserLoadingTest testImplicitPolymorphism with an Ingres exception
{noformat}
<error message="could not execute query" type="org.hibernate.exception.SQLGrammarException">org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism(ASTParserLoadingTest.java:1537)
Caused by: com.ingres.gcf.util.SqlEx: A <column reference> contained a <qualifier> 'product0_'
which did not correspond to any of the <table reference>s
within whose scope the <column reference> appeared.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 38 more
</error>
{noformat}
The SQL query that is produced references product0_ in the WHERE clause of the subselect.
{noformat}
select
product0_.productId as productId37_,
product0_.description as descript2_37_,
product0_.cost as cost37_,
product0_.numberAvailable as numberAv4_37_,
( select
sum(li.quantity)
from
LineItem li
where
li.productId = product0_.productId ) as formula2_
from
Product product0_
{noformat}
Once the scoping error is removed a more fundamental error is exposed "Sub-selects are not supported within select target lists."
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-4973) org.hibernate.test.hql.ASTParserLoadingTest error running testSelectClauseSubselect with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testSelectClauseSubselect with Ingres
-----------------------------------------------------------------------------------------------
Key: HHH-4973
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4973
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
Error executing testSelectClauseSubselect in org.hibernate.test.hql.ASTParserLoadingTest with an Ingres exception
{noformat}
<error message="could not execute query" type="org.hibernate.exception.SQLGrammarException">org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.hql.ASTParserLoadingTest.testSelectClauseSubselect(ASTParserLoadingTest.java:1057)
Caused by: com.ingres.gcf.util.SqlEx: A <column reference> contained a <qualifier> 'animal0_'
which did not correspond to any of the <table reference>s
within whose scope the <column reference> appeared.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 38 more
</error>
{noformat}
The SQL query that is produced references animal0_ in the WHERE clause of the sub-select.
{noformat}
select
(select
max(zoo1_.id)
from
Zoo zoo1_
where
animal0_.zoo_id=zoo1_.id) as col_0_0_
from
Animal animal0_
{noformat}
Once the scoping error is removed a more fundamental error is exposed "Sub-selects are not supported within select target lists."
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-4970) org.hibernate.test.hql.ASTParserLoadingTest error running testComponentParameterBinding with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testComponentParameterBinding with Ingres
---------------------------------------------------------------------------------------------------
Key: HHH-4970
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4970
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
org.hibernate.test.hql.ASTParserLoadingTest testComponentParameterBinding reports an error executing the test with an Ingres exception.
{noformat}
<error message="could not execute query" type="org.hibernate.exception.SQLGrammarException">org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.hql.ASTParserLoadingTest.testComponentParameterBinding(ASTParserLoadingTest.java:645)
Caused by: com.ingres.gcf.util.SqlEx: A <column reference> contained a <qualifier> 'order0_'
which did not correspond to any of the <table reference>s
within whose scope the <column reference> appeared.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 38 more
</error>
{noformat}
The SQL query that is produced references order0_ in the WHERE clause of the sub-select query
{noformat}
select
order0_.customerId as customerId35_,
order0_.orderNumber as orderNum2_35_,
order0_.orderDate as orderDate35_,
( select
sum(li.quantity*p.cost)
from
LineItem li,
Product p
where
li.productId = p.productId
and li.customerId = order0_.customerId
and li.orderNumber = order0_.orderNumber ) as formula1_
from
CustomerOrder order0_ cross
join
Customer customer1_
where
order0_.customerId=customer1_.customerId
and customer1_.name=?
and order0_.customerId=?
and order0_.orderNumber=?
{noformat}
Once the scoping error is removed a more fundamental error is exposed "Subselects are not supported within select target lists."
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-4026) one-to-one non-lazy loading but Filters Not Applied.
by Sandeep Vaid (JIRA)
one-to-one non-lazy loading but Filters Not Applied.
----------------------------------------------------
Key: HHH-4026
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4026
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.3.2, 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.7, 3.2.6
Environment: Hibernate 3.2.6
Reporter: Sandeep Vaid
Attachments: EntityJoinWalker.java
While fetching one-to-one association, filters are not applied.
I have modified the hibernate code to resolve this issue. With these changes, if filters a are enabled for one-to-one associations,
they will be applied (appear in sql) else not.
Changes Done:
A) In EntityJoinWalker.java >> constructor:line 40
Current Code:
StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize )
//include the discriminator and class-level where, but not filters
.append( persister.filterFragment( getAlias(), Collections.EMPTY_MAP ) );
Changed Code:
StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize );
//include the discriminator and class-level where, but not filters
String filter= persister.filterFragment( getAlias(), enabledFilters);
whereCondition.insert( 0, StringHelper.moveAndToBeginning(filter) );
--
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, 1 month
[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
16 years, 1 month
[Hibernate-JIRA] Created: (HHH-5066) EJB JARs are always re-downloaded on a J2EE application using Java Web Start
by Toni Bennasar Obrador (JIRA)
EJB JARs are always re-downloaded on a J2EE application using Java Web Start
----------------------------------------------------------------------------
Key: HHH-5066
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5066
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: Ubuntu 9.10 / Hibernate Annotations 3.4.0.GA / Hibernate 3.3.1.GA / Hibernate Commons Annotations 3.1.0.GA / Hibernate EntityManager 3.4.0.GA / mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) / Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Reporter: Toni Bennasar Obrador
Attachments: InputStreamZippedJarVisitor.java
Hello folks.
I have an J2EE application that uses JPA through hibernate to access to the database, directly, without a J2EE server. The application works fine when its running on the development enviroment. We deploy the application with java web start (jws), and here comes the problem. When its started from a remote workstation, the application stands frozen 2 minutes until it starts. Looking at the jws console i see that get frozens here:
...
XXX INFO Environment:627 - using JDK 1.4 java.sql.Timestamp handling
XXX INFO Version:14 - Hibernate Commons Annotations 3.1.0.GA
XXX INFO Version:16 - Hibernate EntityManager 3.4.0.GA
< frozen HERE....
XXX INFO AnnotationBinder:419 - Binding entity from annotated class: fac.vta.MovimientoEdicion
...
I have used the tcpdump tool, and i see that the application each time its started downloads AGAIN all our EJB jar files from the web server (they were downloaded the first time we started the application with jws). I did a debug and i see that they are downloaded when the function "doProcessElements" of org.hibernate.ejb.packaging.InputStreamZippedJarVisitor is executed, at this line:
jis = new JarInputStream( jarUrl.openStream() );
Here is my explanation: When you use jws, to this function arrives a jarUrl of this kind: "http://foobar.com/hello/file.jar". This URL was filtered by JarVisitorFactory.getJarURLFromURLEntry class. Initially it was "jar:http//foobar.com/hello/file.jar!/". When you get a url.openConnection() of a "jar:http//foobar.com/hello/file.jar!/" URL, its handled by jws and returns a jws internal CachedJarURLConnection to the locally downloaded JAR, but if you do the url.openConnection() from a "http://foobar.com/hello/file.jar", it returns a HttpURLConnection, and the JAR is downloaded again...
The natural solution should be change to
if( url.startsWith("http:") ) {
URL urlJarCheck = new URL("jar:" + url + "!/");
jis = new JarInputStream( urlJarCheck.openConnection() );
}
but this don't work due to jws sucks. It throws a "no entry name specified" IOException. It seem cannot return a InputStream of the whole jar file at any way i have tried.
The only way i have found to make it work is the one I have put on the attachment.
I have not tested it with the core v3.5.0, but i have checked the code and it seems having the same problem.
If this a good solution you should pay me a beer. lol.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-5067) ManyToMany alias not built in Criteria Query with max fetch depth of 0
by Shawn Clowater (JIRA)
ManyToMany alias not built in Criteria Query with max fetch depth of 0
----------------------------------------------------------------------
Key: HHH-5067
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5067
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.5.0-Final
Environment: Hib 3.5.0 final, Oracle 10g
Reporter: Shawn Clowater
Criteria Queries that used to work in 3.3.2 no longer work in 3.5.0.
They seem to be limited to queries that involve many-to-many associations and based on the fact that we have our Enviroment.MAX_FETCH_DEPTH set to 0
{code}
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(AgmtContractLine.class);
detachedCriteria.createAlias("tradingGroups, "Ree");
detachedCriteria.add(Restrictions.eq("Ree.uuid", "333"));
{code}
Based on the simple Query, joining through the many to many produced the following in 3.3.2
{code}
select
this_.AGMT_CNTRCT_LINE_ID as AGMT1_24_1_,
this_.UUID as UUID24_1_,
this_.CREATE_DATE as CREATE3_24_1_,
this_.CREATE_USER as CREATE4_24_1_,
this_.UPDATE_DATE as UPDATE5_24_1_,
this_.UPDATE_USER as UPDATE6_24_1_,
this_.AGMT_CNTRCT_ID as AGMT7_24_1_,
this_.NOTE_H_ID as NOTE8_24_1_,
tradinggro3_.AGMT_CNTRCT_LINE_ID as AGMT1_,
ree1_.TRADING_GROUP_ID as TRADING2_,
ree1_.TRADING_GROUP_ID as TRADING1_324_0_,
ree1_.UUID as UUID324_0_,
ree1_.CREATE_DATE as CREATE3_324_0_,
ree1_.CREATE_USER as CREATE4_324_0_,
ree1_.UPDATE_DATE as UPDATE5_324_0_,
ree1_.UPDATE_USER as UPDATE6_324_0_,
ree1_.DESCRIPTION as DESCRIPT7_324_0_,
ree1_.EXPIRY_DATE as EXPIRY8_324_0_,
ree1_.SYSTEM_DEPENDANT_FLG as SYSTEM9_324_0_,
ree1_.TRADING_GROUP_CODE as TRADING10_324_0_,
ree1_.TRADING_GROUP_TYPE_ID as TRADING11_324_0_
from
AGMT_CNTRCT_LINE this_
inner join
AGMT_CNTRCT_LINE_GROUP_XREF tradinggro3_
on this_.AGMT_CNTRCT_LINE_ID=tradinggro3_.AGMT_CNTRCT_LINE_ID
inner join
TRADING_GROUP ree1_
on tradinggro3_.TRADING_GROUP_ID=ree1_.TRADING_GROUP_ID
where
ree1_.UUID=?
{code}
The same thing in 3.5.0 produced:
{code}
select
this_.AGMT_CNTRCT_LINE_ID as AGMT1_25_0_,
this_.UUID as UUID25_0_,
this_.CREATE_DATE as CREATE3_25_0_,
this_.CREATE_USER as CREATE4_25_0_,
this_.UPDATE_DATE as UPDATE5_25_0_,
this_.UPDATE_USER as UPDATE6_25_0_,
this_.AGMT_CNTRCT_ID as AGMT7_25_0_,
this_.NOTE_H_ID as NOTE8_25_0_,
from
AGMT_CNTRCT_LINE this_
inner join
AGMT_CNTRCT_LINE_GROUP_XREF tradinggro3_
on this_.AGMT_CNTRCT_LINE_ID=tradinggro3_.AGMT_CNTRCT_LINE_ID
where
ree1_.UUID=?
{code}
Using the hib core tag I added the following test to org.hibernate.test.annotations.manytomany.ManyToManyTest
{code}
public void testCanUseCriteriaQuery() throws Exception {
Session s;
Transaction tx;
s = openSession();
tx = s.beginTransaction();
Store fnac = new Store();
fnac.setName("Fnac");
Supplier emi = new Supplier();
emi.setName("Emmanuel");
emi.setSuppStores(new HashSet<Store>());
fnac.setSuppliers(new HashSet<Supplier>());
fnac.getSuppliers().add(emi);
emi.getSuppStores().add(fnac);
s.persist(fnac);
tx.commit();
s.close();
s = openSession();
List result = DetachedCriteria.forClass(Supplier.class)
.createAlias("suppStores", "s")
.add(Restrictions.eq("s.name", "I don't even need a match"))
.getExecutableCriteria(s)
.list();
s.close();
assertEquals(0, result.size());
}
{code}
This will work fine unless the max fetch depth is set to 0 (i flipped it when the session factory is rebuilt in TestCase)at which point the following exception will be thrown.
{code}
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2297)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
at org.hibernate.loader.Loader.list(Loader.java:2167)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at org.hibernate.test.annotations.manytomany.ManyToManyTest.testCanUseCriteriaQuery(ManyToManyTest.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.hibernate.test.annotations.HibernateTestCase.runTest(HibernateTestCase.java:112)
at org.hibernate.test.annotations.HibernateTestCase.runBare(HibernateTestCase.java:100)
at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:165)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)
Caused by: java.sql.SQLException: Unexpected token: FROM in statement [select this_.id as id8_0_, this_.name as name8_0_, from Supplier this_ inner join StoreSupplier suppstores3_ on this_.id=suppstores3_.supplier where s1_.name=?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1596)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
... 28 more
{code}
--
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, 1 month
[Hibernate-JIRA] Created: (HSEARCH-479) Return empty result list - Composed primary key - lucene search ok - primary key bridge ok
by Gaël Saunier (JIRA)
Return empty result list - Composed primary key - lucene search ok - primary key bridge ok
------------------------------------------------------------------------------------------
Key: HSEARCH-479
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-479
Project: Hibernate Search
Issue Type: Bug
Components: mapping
Affects Versions: 3.1.0.GA
Environment: Eclipse SDK - Version: 3.3.2
MySql - 5.1.44-community
PostgreSQL - 1.8.3
Hibernate Search - 3.1.0.GA
hibernate-entitymanager - 3.4.0.GA
hibernate-annotations - 3.4.0.GA
hibernate-core - 3.3.2.GA
Reporter: Gaël Saunier
Entity :
@Indexed
@Entity
public class Demande extends DemandeEntity {
...
Superclass :
...
@MappedSuperclass
public class DemandeEntity implements Serializable {
...
@FieldBridge(impl=Demande_DocumentId_Bridge.class)
@DocumentId
@IndexedEmbedded
private DemandePK demandePK;
...
Bridge :
...
public class Demande_DocumentId_Bridge implements TwoWayStringBridge {
...
public Object stringToObject(String arg0) {
String[] tab = arg0.split("þ");
return new DemandePK(tab[0],tab[1],tab[2]);
}
...
public String objectToString(Object arg0) {
DemandePK d = (DemandePK)arg0;
return d.getUiPhar()+"þ"+d.getRdes()+"þ"+d.getTypeDem();
}
}
TestClass :
...
public static void main(String[] args) {
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("META-INF/PostGreSQL-applicationContext.xml");
GenericSearchManagerMetier demandeSearchManagerMetier = (GenericSearchManagerMetier) appContext.getBean("demandeSearchManagerMetier");
String rqt = "+text:jean +text:francois";
BeanLuceneQuery beanLuceneQuery = new BeanLuceneQuery(rqt);
BeanResultats br = null;
try {
br = demandeSearchManagerMetier.searchLuceneQuery(beanLuceneQuery,0,15);
} catch (NegativeOrNullInteger e) {
e.printStackTrace();
}
System.out.print("Nb total : "+br.getNbTotalResults()+"\n");
System.out.print("Nb Résultats : "+br.getResults().size()+"\n");
}
Lucene part of process is alright !
Primary keys DemandePK generated by HS just before requesting DB are alright
but no return...
br.getNbTotalResults() return 16
but
br.getResults().size() return 0
Beans are correctly implemented.
I traced return of :
List<T> resultList = q.getResultList();
but list size = 0
stdout :
...
Hibernate: select this_ (..xxx..) from Demande this_ where ((this_.RDES, this_.TYPE_DEM, this_.UI_PHAR) in ((?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)))
Nb total : 16
Nb Résultats : 0
--
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, 1 month
[Hibernate-JIRA] Created: (HSEARCH-484) Building documentation fails
by Sanne Grinovero (JIRA)
Building documentation fails
----------------------------
Key: HSEARCH-484
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-484
Project: Hibernate Search
Issue Type: Bug
Components: documentation
Environment: Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.31-21-generic" arch: "amd64" Family: "unix"
Java version: 1.6.0_19
Reporter: Sanne Grinovero
Fix For: 3.2.0.Beta2
Building docs is failing:
[INFO] One or more required plugin parameters are invalid/missing for 'jdocbook:resources'
[0] Inside the definition for plugin 'maven-jdocbook-plugin' specify the following:
<configuration>
...
<formats>VALUE</formats>
</configuration>.
[1] Inside the definition for plugin 'maven-jdocbook-plugin' specify the following:
<configuration>
...
<sourceDocumentName>VALUE</sourceDocumentName>
</configuration>.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-5065) Exception thrown by Configuration.getRootClassMapping(String) not helpful
by Stefan Fussenegger (JIRA)
Exception thrown by Configuration.getRootClassMapping(String) not helpful
-------------------------------------------------------------------------
Key: HHH-5065
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5065
Project: Hibernate Core
Issue Type: Improvement
Affects Versions: 3.3.2
Environment: hibernate-core-3.3.2.GA.jar
Reporter: Stefan Fussenegger
Priority: Trivial
current code:
{code:java}
RootClass getRootClassMapping(String clazz) throws MappingException {
try {
return (RootClass) getClassMapping( clazz );
}
catch (ClassCastException cce) {
throw new MappingException( "You may only specify a cache for root <class> mappings" );
}
}
{code}
this causes exception message to be "You may only specify a cache for root <class> mappings". As a result, the user will have to check all cache configurations or set a breakpoint to get the value of {{clazz}} that caused the error. To simplify this process, add {{clazz}} to the message, e.g. {{"You may only specify a cache for root <class> mappings, was " + clazz}}
--
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, 1 month