[Hibernate-JIRA] Created: (HHH-2676) Cannot apply UPGRADE lock to scalar Query object
by John Wood (JIRA)
Cannot apply UPGRADE lock to scalar Query object
------------------------------------------------
Key: HHH-2676
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2676
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.1
Reporter: John Wood
Priority: Minor
Attachments: Bean.hbm.xml, Bean.java
If you try and add a lock to a Query object (against a named alias) when doing a scalar HQL query (e.g. "select sum(foo) from bah") then an error occurs.
The sample code (full working example is attached):
// Create query
Query q = session.createQuery("select b.value from Bean b");
// Set lock mode on query
q.setLockMode("b", LockMode.UPGRADE);
// Executre
q.list();
This causes the following error:
Exception in thread "main" java.lang.IllegalArgumentException: could not locate alias to apply lock mode : b
at org.hibernate.loader.hql.QueryLoader.applyLocks(QueryLoader.java:297)
at org.hibernate.loader.Loader.preprocessSQL(Loader.java:201)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
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:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
I have tried this both with an older version of Hibernate (3.1) and the latest with the same result (although the older Hibernate has the error message "alias not found".
I have attached a simple example to demonstrate this.
See also HHH-1965.
Perhaps, it is simply that one cannot lock scalar queries of this type. If so, then the fix would presumably be to include this in the Query class Javadocs.
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-4802) Connection leak with Spring, JDBC and exhausted pool
by John Kristian (JIRA)
Connection leak with Spring, JDBC and exhausted pool
----------------------------------------------------
Key: HHH-4802
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4802
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: Hibernate 3.3.2
Spring 2.5.6
Reporter: John Kristian
Attachments: testHibernate.zip
Session.close fails to close a JDBC Connection, if the first two calls to the connection (getAutoCommit and isClosed) throw SQLException and subsequent calls don't throw exceptions.
That's unusual behavior for a Connection, but it happens. One example is a Spring TransactionAwareDataSourceProxy, with a connection pool that's temporarily exhausted. Spring attempts to get a connection from the pool on each call to a Connection method. The first two calls may fail because the pool is exhausted, but the third call may allocate a connection and succeed. Other connection pooling systems behave this way.
This creates a vicious cycle: if the pool is temporarily exhausted, Hibernate leaks a connection, which makes it more likely that the pool will become exhausted. If demand for connections doesn't stop, all the connections will leak and the pool will be permanently exhausted.
The attached test case is also available via Mercurial `hg clone http://bitbucket.org/jmkristian/example` (in the testHibernate subdirectory).
I posted to https://forum.hibernate.org/viewtopic.php?f=1&t=1001942 but saw no response.
--
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, 3 months
[Hibernate-JIRA] Created: (HSEARCH-445) ERROR [JDBCExceptionReporter] Incorrect syntax near '-'.
by azael espinosa (JIRA)
ERROR [JDBCExceptionReporter] Incorrect syntax near '-'.
--------------------------------------------------------
Key: HSEARCH-445
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-445
Project: Hibernate Search
Issue Type: Bug
Components: query
Environment: SQL server 2005, maven2, jboss-5.1.0.GA, jboss-seam-2.2.0.GA, seam gen reverse engineer,Ant 1.6
Reporter: azael espinosa
Priority: Critical
The project was created by seam-gen EAR format
I think it's a bug, but do not know how to fix it.
I hope I can help
regards
11:25:54,610 WARN [JDBCExceptionReporter] SQL Error: 102, SQLState: S0001
11:25:54,610 ERROR [JDBCExceptionReporter] Incorrect syntax near '-'.
11:25:54,641 SEVERE [viewhandler] Error Rendering View[/EmpleadoList.xhtml]
javax.el.ELException: /EmpleadoList.xhtml: Error reading 'resultList' on type co
m.baf.action.EmpleadoList_$$_javassist_seam_3
at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:
48)
at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.j
ava:39)
at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275
)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRendere
r.java:189)
at org.richfaces.renderkit.html.PanelRenderer.doEncodeBegin(PanelRendere
r.java:148)
at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:100
)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav
a:813)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.jav
a:592)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWra
pper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.j
ava:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePha
se.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:83)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFil
ter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
lter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
yAssociationValve.java:190)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
e.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.proce
ss(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invok
e(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
onnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGr
ammarException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException
(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:
80)
at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:7
1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
Context.java:32)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
Context.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackI
nterceptor.java:28)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
Context.java:68)
at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionI
nterceptor.java:97)
at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(Transa
ctionInterceptor.java:91)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
Context.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodConte
xtInterceptor.java:44)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
Context.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
107)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(Java
BeanInterceptor.java:185)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanIntercept
or.java:103)
at com.baf.action.EmpleadoList_$$_javassist_seam_3.getResultList(Emplead
oList_$$_javassist_seam_3.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELRe
solver.java:72)
at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java
:53)
at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
at org.jboss.el.parser.AstChoice.getValue(AstChoice.java:27)
at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:18
6)
at com.sun.facelets.el.ELText$ELTextVariable.writeText(ELText.java:184)
at com.sun.facelets.el.ELText$ELTextComposite.writeText(ELText.java:108)
at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:
45)
... 58 more
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
ava:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
er.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2231)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja
va:361)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java
:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
... 94 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax nea
r '-'.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError
(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown S
ource)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknow
n Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(
Unknown Source)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery
(WrappedPreparedStatement.java:342)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo
ader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2228)
... 102 more
11:25:54,797 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:25:54,797 ERROR [JDBCExceptionReporter] Transaction is not active: tx=Transac
tionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e status: ActionStatus.ABOR
T_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is
not active: tx=TransactionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e sta
tus: ActionStatus.ABORT_ONLY >)
11:25:54,797 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:25:54,797 ERROR [JDBCExceptionReporter] Transaction is not active: tx=Transac
tionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e status: ActionStatus.ABOR
T_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is
not active: tx=TransactionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e sta
tus: ActionStatus.ABORT_ONLY >)
11:25:54,813 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:25:54,813 ERROR [JDBCExceptionReporter] Transaction is not active: tx=Transac
tionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e status: ActionStatus.ABOR
T_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is
not active: tx=TransactionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e sta
tus: ActionStatus.ABORT_ONLY >)
11:25:54,813 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:25:54,813 ERROR [JDBCExceptionReporter] Transaction is not active: tx=Transac
tionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e status: ActionStatus.ABOR
T_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is
not active: tx=TransactionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e sta
tus: ActionStatus.ABORT_ONLY >)
11:25:54,860 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
11:25:54,860 ERROR [JDBCExceptionReporter] Transaction is not active: tx=Transac
tionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e status: ActionStatus.ABOR
T_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is
not active: tx=TransactionImple < ac, BasicAction: -53eef31e:fb0:4b50a295:7e sta
tus: ActionStatus.ABORT_ONLY >)
--
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, 3 months
[Hibernate-JIRA] Created: (HSEARCH-248) Incorrect syntax near ', ' with org.hibernate.dialect.SQLServerDialect
by Isaac F (JIRA)
Incorrect syntax near ',' with org.hibernate.dialect.SQLServerDialect
---------------------------------------------------------------------
Key: HSEARCH-248
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-248
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.0.1.GA
Environment: Sql Server 2005, hibernate 3.2.6
Reporter: Isaac F
I get this exception when I make a createFullTextQuery with an Entity that have composite-id (I use TwoWayStringBridge impl to transform)
org.hibernate.util.JDBCExceptionReporter[main] - SQL Error: 102, SQLState: S0001
org.hibernate.util.JDBCExceptionReporter[main] - Incorrect syntax near ','.
A generated query is this:
/* criteria query */ select
this_.CE_CIF as CE1_0_0_,
this_.CE_FORMA_JURIDICA as CE2_0_0_,
this_.CE_DISCRIMINANTE as CE3_0_0_,
this_.CE_DELEGACION as CE4_0_0_,
from
CH_TERCEROS this_
where
(
(
this_.CE_CIF, this_.CE_FORMA_JURIDICA, this_.CE_DISCRIMINANTE, this_.CE_DELEGACION
) in (
(
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
), (
?, ?, ?, ?
)
)
)
but this syntax is not support by Sql Server 2005
Thanks
--
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, 3 months