[Hibernate-JIRA] Created: (HHH-6835) SqlServer dialect 2008, error "column was specified multiple times" when using limit and offset
by Nils Dennefors (JIRA)
SqlServer dialect 2008, error "column was specified multiple times" when using limit and offset
-----------------------------------------------------------------------------------------------
Key: HHH-6835
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6835
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.8
Environment: 3.6.8 sqlserver 2008, 10.00.1600
Reporter: Nils Dennefors
Priority: Minor
Can't use limit and offset on (jpql) queries when a column is defined two times and using different cases on entity.
Like in the example below name="FIRM_ID" and name="firm_id"
If I use the same case on column definition the problem disappears.
Perhaps the dialect should do a case-insensitive check on column name?
{{@Entity}}
{{public class Customer {}}
{{(a)ManyToOne(targetEntity=Firm.class)}}
{{@JoinColumn(name="FIRM_ID",referencedColumnName="id",insertable=false,updatable=false)}}
{{Firm firm;}}
{{@Column(name = "firm_id")}}
{{public Long firmId;}}
{{@Id}}
{{@Column(name = "cust_id", nullable = false)}}
{{public Long customerNr;}}
{{}}}
{{@Entity}}
{{public class Firm {}}
{{@Id}}
{{(a)GeneratedValue(strategy=GenerationType.IDENTITY)}}
{{Long id;}}
{{}}}
When executing this:
{{List<Firm> resultList = em.createQuery("select a from Customer a").setFirstResult(1).setMaxResults(2).getResultList();}}
Hibernate executes sql:
{{WITH query AS (select ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __hibernate_row_nr__, customer0_.cust_id as cust1_0_, customer0_.firm_id as firm2_0_, customer0_.firm_id as firm2_0_ from customer customer0_) SELECT * FROM query WHERE __hibernate_row_nr__ BETWEEN ? AND ?}}
Which is not valid because firm2_0_ is used two times.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-6377) org.hibernate.cache.infinispan.util.CacheHelper$EvictAll deserialziation issues when running on infinispan clusetr for 2bd Level Cache
by Raúl Raja Martínez (JIRA)
org.hibernate.cache.infinispan.util.CacheHelper$EvictAll deserialziation issues when running on infinispan clusetr for 2bd Level Cache
--------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-6377
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6377
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.6.1
Environment: 3.6.1 Final
Reporter: Raúl Raja Martínez
When running a infinispan cluster for Hibernate 2nd level cache the following exception is shown if a state transfer is attempted between nodes. Also note that lastes released version of JBOSS Marshalling does not show the real exception see https://issues.jboss.org/browse/JBMAR-121.
The following stack trace is shown when building latest JBOSS Marshalling from sources.
The problems seems to be that the private static inner class EvictAll does not provide a default constructor for serialization.
Thread-2 06/28 21:48:26 WARN org.infinispan.remoting.rpc.RpcManagerImpl - ISPN00075: Could not find available peer for state, backing off and retrying
Incoming-2,infinispan-hibernate-cache-cluster,ip-10-38-26-245-34074 06/28 21:48:34 ERROR org.infinispan.remoting.transport.jgroups.JGroupsTransport - ISPN00096: Caught while requesting or applying state
org.infinispan.statetransfer.StateTransferException: java.io.InvalidClassException: org.hibernate.cache.infinispan.util.CacheHelper$EvictAll; Class is non-public or has no public no-arg constructor
at org.infinispan.statetransfer.StateTransferManagerImpl.applyInMemoryState(StateTransferManagerImpl.java:311)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyState(StateTransferManagerImpl.java:280)
at org.infinispan.remoting.InboundInvocationHandlerImpl.applyState(InboundInvocationHandlerImpl.java:230)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.setState(JGroupsTransport.java:604)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:711)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:771)
at org.jgroups.JChannel.up(JChannel.java:1441)
at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1074)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.connectToStateProvider(STREAMING_STATE_TRANSFER.java:523)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.handleStateRsp(STREAMING_STATE_TRANSFER.java:462)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:223)
at org.jgroups.protocols.FRAG2.up(FRAG2.java:189)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:418)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:400)
at org.jgroups.protocols.pbcast.GMS.up(GMS.java:891)
at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:246)
at org.jgroups.protocols.UNICAST.handleDataReceived(UNICAST.java:613)
at org.jgroups.protocols.UNICAST.up(UNICAST.java:294)
at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:703)
at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:133)
at org.jgroups.protocols.FD.up(FD.java:275)
at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:275)
at org.jgroups.protocols.MERGE2.up(MERGE2.java:209)
at org.jgroups.protocols.Discovery.up(Discovery.java:291)
at org.jgroups.protocols.TP.passMessageUp(TP.java:1102)
at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1658)
at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1640)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.InvalidClassException: org.hibernate.cache.infinispan.util.CacheHelper$EvictAll; Class is non-public or has no public no-arg constructor
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1250)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:132)
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:123)
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:357)
at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:245)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.marshall.exts.SetExternalizer.readObject(SetExternalizer.java:78)
at org.infinispan.marshall.exts.SetExternalizer.readObject(SetExternalizer.java:47)
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:357)
at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:245)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.marshall.jboss.GenericJBossMarshaller.objectFromObjectStream(GenericJBossMarshaller.java:191)
at org.infinispan.marshall.VersionAwareMarshaller.objectFromObjectStream(VersionAwareMarshaller.java:191)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyInMemoryState(StateTransferManagerImpl.java:306)
... 29 more
Caused by: an exception which occurred:
in object of type org.hibernate.cache.infinispan.util.CacheHelper$EvictAll
Thread-2 06/28 21:48:34 WARN org.infinispan.remoting.rpc.RpcManagerImpl - ISPN00075: Could not find available peer for state, backing off and retrying
--
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, 4 months
[Hibernate-JIRA] Assigned: (HHH-6700) mysql test failures
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700?page=c... ]
Strong Liu reassigned HHH-6700:
-------------------------------
Assignee: Strong Liu
> mysql test failures
> -------------------
>
> Key: HHH-6700
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700
> Project: Hibernate Core
> Issue Type: Sub-task
> Environment: MySql 51
> Reporter: Strong Liu
> Assignee: Strong Liu
>
> org.hibernate.test.hql.ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl
> org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery
> org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedManyToOne
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedOneToMany
> org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest.testUsage
> org.hibernate.test.id.uuid.strategy.CustomStrategyTest.testUsage
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testCustomColumnReadAndWrite
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testFetchAll
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testPropertyInitialized
> org.hibernate.test.querycache.QueryCacheTest.testCaseInsensitiveComparison
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testTextTypeInSQLQuery
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testImageTypeInSQLQuery
> org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testScalarStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testParameterHandling
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testEntityStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testHandSQL
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-6832) Hibernate doesn't recognize a field with same name and different capitalization with the discriminator field
by Amir Pashazadeh (JIRA)
Hibernate doesn't recognize a field with same name and different capitalization with the discriminator field
------------------------------------------------------------------------------------------------------------
Key: HHH-6832
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6832
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.8
Environment: Oracle 11g
Sun JDK 6
Hibernate 3.6.6 & 3.6.8
Tomcat 6.0.18
Reporter: Amir Pashazadeh
Attachments: discriminator-capitalization.zip
I have a entity with a discriminator column mapped as
{code}
@DiscriminatorColumn("discriminator")
{code}
and I mapped the column in entity as
{code}
@Column("Discriminator", insertable=false, updatable=false)
{code}
(the capitalization of the column names are different).
When querying the entity, hibernate creates a query as:
{code:sql}
select
...
this_0.discriminator DISCRI_1525,
...
this_0.Discriminator DISCRI_1525,
...
{code}
as you see the database column is selected twice, but with the same alias.
If you page this query using Oracle dialect, an *ORA-00918: column ambiguously defined* will occur.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-6831) Alter and drop columns with hbm2ddl.auto=update
by Bozhidar Bozhanov (JIRA)
Alter and drop columns with hbm2ddl.auto=update
-----------------------------------------------
Key: HHH-6831
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6831
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.6.8
Reporter: Bozhidar Bozhanov
Currently hbm2ddl.auto=update only creates new columns. It doesn't alter or drop columns. This can be done fairly easily - just compare the entity model to the database metadata.
This may be configurable (on/off, to support legacy databases where not all columns and tables are mapped in entities). Note that dropping columns is only required if they are not-null, because if a column does not have a default value and is not-null, and is no longer mapped, the queries will fail. Instead of dropping, hbm2ddl.auto can simply set them to allow null values.
In addition to columns, this can be extended to constraints as well.
It would be really nice to have it so that you can mimic the development process with schemaless nosql databases, where the database depends entirely on the code that uses it.
Optionally, for those willing to risk it, this can even be used in production (after being tested on a stage server, of course). That way you would be able to go almost completely without database migration scripts. Whether this is a good practice is a different topic.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months