[Hibernate-JIRA] Created: (HHH-5315) AuditJoinTable rows are no longer flushed to the database
by Erik-Berndt Scheper (JIRA)
AuditJoinTable rows are no longer flushed to the database
---------------------------------------------------------
Key: HHH-5315
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5315
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5.2, 3.5.1
Environment: JPA with extended persistence context
Reporter: Erik-Berndt Scheper
Priority: Minor
In Hibernate core 3.5.1 issue HHH-3543 was fixed by using BeforeTransactionCompletionProcess instead of a transaction synchronization. I have found that since this change, rows in AuditJoinTables are no longer flushed to the database. (Envers 3.5.0 final works fine).
I can work around the issue by adding a manual entityManager.flush() or by setting the flushmode to manual.
I have noticed that AuditProcess.java already executes a flush() statement, but this does not seem to suffice. I believe this is caused by the fact that during the doBeforeTransactionCompletion() extra WorkUnits are added to the hibernate ActionQueue (PersistentCollectionChangeWorkUnit) which process the AuditJoinTables.
--
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] Commented: (HHH-956) MSSQL: Distinct queries require all ORDER BY attributes to be selected.
by Wendy Schmitz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-956?page=co... ]
Wendy Schmitz commented on HHH-956:
-----------------------------------
This might help with explaining the cause of the error and why it is not a Hibernate bug: http://weblogs.sqlteam.com/jeffs/archive/2007/12/13/select-distinct-order...
> MSSQL: Distinct queries require all ORDER BY attributes to be selected.
> -----------------------------------------------------------------------
>
> Key: HHH-956
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-956
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: Running HB 3.0.5 but I tried this on the 3.1 beta 3 and got the same error. DB: MS SQL Server 2000 on Windows 2003 Server, JDK 1.4.2_05
> Reporter: Shanon Levenherz
> Attachments: order-by-bug.zip
>
>
> Using Criteria queries with a Distinct projection AND an ORDER BY clause with Microsoft SQL Server cause the following SQL error:
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
> this is the culprit query:
> 2005-09-14 11:12:47,570 DEBUG org.hibernate.SQL - select distinct this_.content_id as y0_ from iwsc_content this_ left outer join iwsc_news this_1_ on this_.content_id=this_1_.content_id left outer join iwsc_event this_2_ on this_.content_id=this_2_.content_id left outer join iwsc_document this_3_ on his_.content_id=this_3_.content_id inner join iwsc_content_category categories3_ on this_.content_id=categories3_.content_id inner join iwsc_category category1_ on categories3_.category_id=category1_.category_id where (this_.expiration_date is null or this_.expiration_date>?) and category1_.category_id in (?, ?, ?, ?) and this_.branch in (?) order by this_.creation_date desc
> 2005-09-14 11:12:47,570 DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
> 2005-09-14 11:12:47,570 DEBUG org.hibernate.type.TimestampType - binding '2005-09-14 00:00:00' to parameter: 1
> 2005-09-14 11:12:47,580 DEBUG org.hibernate.type.LongType - binding '100000005' to parameter: 2
> 2005-09-14 11:12:47,580 DEBUG org.hibernate.type.LongType - binding '100000010' to parameter: 3
> 2005-09-14 11:12:47,580 DEBUG org.hibernate.type.LongType - binding '100000015' to parameter: 4
> 2005-09-14 11:12:47,580 DEBUG org.hibernate.type.LongType - binding '100000020' to parameter: 5
> 2005-09-14 11:12:47,580 DEBUG org.hibernate.type.StringType - binding '/default/main/solutions/SalesSolution' to parameter: 6
> 2005-09-14 11:12:47,600 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
> 2005-09-14 11:12:47,600 DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
> and this is how i fixed it ( added in the creation date in the select )-- note that this isn't in code, i just did it in sql query analyzer.
> select distinct this_.content_id as y0_, this_.creation_date from iwsc_content this_ left outer join iwsc_news this_1_ on this_.content_id=this_1_.content_id left outer join iwsc_event this_2_ on this_.content_id=this_2_.content_id left outer join iwsc_document this_3_ on this_.content_id=this_3_.content_id inner join iwsc_content_category categories3_ on this_.content_id=categories3_.content_id inner join iwsc_category category1_ on categories3_.category_id=category1_.category_id where category1_.category_id in (100000005,100000010,100000015,100000020) and this_.branch in ('/default/main/solutions/SalesSolution') order by this_.creation_date desc
> in attachment:
> tomcat_out.log -- full debug on.
> code.txt - java snippets of how i'm building and executing the criteria.
> mapping_files.zip - the hbm's used to map... only Content and Category should apply here.
> please let me know if you need any further information.
--
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] Created: (HHH-5433) Inconsistent jdk versions for hibernate3.jar and org/hibernate/cache/infinispan/tm/HibernateTransactionManagerLookup.class
by Luis Carvajal (JIRA)
Inconsistent jdk versions for hibernate3.jar and org/hibernate/cache/infinispan/tm/HibernateTransactionManagerLookup.class
--------------------------------------------------------------------------------------------------------------------------
Key: HHH-5433
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5433
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.5.4
Environment: Linux Ubuntu
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
hibernate-distribution-3.5.4-Final
Reporter: Luis Carvajal
The manifest within the hibernate3.jar says it was created with jdk 1.5
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: gbadner
Build-Jdk: 1.5.0_16
Specification-Title: Hibernate Distribution
Specification-Version: 3.5.4-Final
However, the following cache components have 1.6 version(as you can see in the byte 7, with code 0x32, corresponding to java major version 1.6):
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/tm/HibernateTransactionManagerLookup.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/PutFromLoadValidator$PendingPut.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/PutFromLoadValidator$PendingPutMap.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/TransactionalAccessDelegate.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/PutFromLoadValidator$RecentRemoval.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/PutFromLoadValidator$1.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/access/PutFromLoadValidator.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/collection/ReadOnlyAccess.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/collection/CollectionRegionImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/collection/TransactionalAccess.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/FlagAdapter$1.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/FlagAdapter.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/AddressAdapter.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheHelper$EvictAll.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheHelper.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheHelper$NoAddress.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/AddressAdapterImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheHelper$Internal.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheAdapterImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/util/CacheAdapter.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/impl/BaseGeneralDataRegion.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/impl/BaseRegion.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/impl/BaseTransactionalDataRegion.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/impl/BaseRegion$InvalidateState.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/query/QueryResultsRegionImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/InfinispanRegionFactory.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/entity/EntityRegionImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/entity/ReadOnlyAccess.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/entity/TransactionalAccess.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/timestamp/TimestampTypeOverrides.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/timestamp/TimestampsRegionImpl.class
0:0:0:32 ./hibernate3/org/hibernate/cache/infinispan/TypeOverrides.class
This prevents the official jar from being used with 1.5 virtual machines.
The cache component in the official binary release should be compiled with 1.5 and the manifest should
indicate the greatest major version of all .class files it contains.
--
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] Created: (HHH-5212) Alter SQLFunction contract to be more flexible
by Steve Ebersole (JIRA)
Alter SQLFunction contract to be more flexible
----------------------------------------------
Key: HHH-5212
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5212
Project: Hibernate Core
Issue Type: Improvement
Components: core, query-criteria, query-hql
Reporter: Steve Ebersole
The SQLFunction contract currently combines contextual information (render/getReturnType) and non-contextual (aka non-changing) information (hasArguments/hasParenthesesIfNoArguments).
An example I just ran into where separating these would have been nice is in HHH-5173. Some dialects return the argument data type when applying the AVG() function. That is problematic for INTEGER values because the decimal portion gets dropped. On those databases one would need to CAST() the argument to get the correct behavior. However, again, this is only necessary based on the argument type. If the argument type is already a non-integer the cast is uneeded.
Proposal (as always name subject to change/suggestion):
{code}
interface SQLFunction {
public boolean hasArguments();
public boolean hasParenthesesIfNoArguments();
public RenderingContext getRenderingContext(Type columnType, SessionFactoryImplementor factory);
public static interface RenderingContext {
public Type getReturnType();
public String render(List args);
}
}
{code}
I used SessionFactoryImplementor as the argument to getRenderingContext, but the current getReturnType accepts a Mapping. Is there really ever a time when we call that method when we do not have a SessionFactory? My usage search shows no usages of this method passing in a Configuration (which is the other Mapping implementor aside from SessionFactory).
--
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