[Hibernate-JIRA] Created: (HHH-5580) tracking entity names in a revision
by Vardan Akopian (JIRA)
tracking entity names in a revision
-----------------------------------
Key: HHH-5580
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5580
Project: Hibernate Core
Issue Type: New Feature
Components: envers
Affects Versions: 3.5.5
Environment: hibernate 3.5.5
Reporter: Vardan Akopian
Attachments: envers-entity-names.patch
Currently Envers provides no way of finding which entities have been affected in a given revision. I.e. given a revision number it's impossible to find all the versions of all the entities for that revision. For example, all the search methods in the AuditQuery API take the entity class as a parameter. In our application we need to be able to retrieve all the changes for a given revision number without prior knowledge of which entities have been modified. Similar questions and requests have been posted in the envers forums before. The attached patch has a simple implementation for this feature. It adds 2 simple methods to the RevisionListener interface, that are called from AuditProcess and allow the Revision Entity to keep track of the entity names that are changed. The test cases show the simple usage for this.
--
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
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6600) Clustered L2 cache does not support class definition updates
by Konrad Garus (JIRA)
Clustered L2 cache does not support class definition updates
------------------------------------------------------------
Key: HHH-6600
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6600
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.3.1
Reporter: Konrad Garus
Hibernate caches raw arrays of field values in L2 cache. If that cache is clustered, and you want to update nodes one by one, you can get into a lot of trouble. Session may fetch a cache entry with old schema and blindly try and copy it to an entity. Sometimes it leads to ClassCastException. It also may lead to data corruption (disassembling a field as null and then saving that to database).
There does not seem to be a way to work this around. serialVersionUID is unsupported and I don't see a way to mark entity definition version anywhere in the mapping.
I'm experiencing this in 3.3.1, but from a brief source code inspection it seems to still be an issue in 4.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (JPA-22) EntityManager.contains unsupport Entity enhanced by CGLIB
by vangie du (JIRA)
EntityManager.contains unsupport Entity enhanced by CGLIB
---------------------------------------------------------
Key: JPA-22
URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-22
Project: Java Persistence API
Issue Type: Bug
Affects Versions: 1.0.1
Reporter: vangie du
invoke contains() method with a entity enhanced by CGLIB while throw IllegalArgumentException.
other methods like persit() remove() can config the hibernate interceptor by override the getEntityName().
public class UnByteCodeProxyInterceptor extends EmptyInterceptor {
private static final long serialVersionUID = -6422637558312349795L;
@Override
public String getEntityName(Object object) {
if (object != null) {
Class<?> cl = object.getClass();
if (ProxyBeanUtils.isProxy(cl)) {
cl = cl.getSuperclass();
}
return cl.getName();
}
else {
return null;
}
}
}
but the contains() not invoke the entityNameResolver to get Entity name.
statement in org.hibernate.ejb.AbstractEntityManagerImpl.contains()
getSession().getSessionFactory().getClassMetadata( entity.getClass() )
change to
getSession().getSessionFactory().getClassMetadata( ((SessionImplementor)getSession()).bestGuessEntityName(entity) )
can workaround this problem.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (OGM-83) NoSuchMethodError at CacheManagerServiceProvider.createCustomCacheManager
by raul davidovich (JIRA)
NoSuchMethodError at CacheManagerServiceProvider.createCustomCacheManager
-------------------------------------------------------------------------
Key: OGM-83
URL: http://opensource.atlassian.com/projects/hibernate/browse/OGM-83
Project: Hibernate OGM
Issue Type: Bug
Components: core
Affects Versions: 3.0.0.Alpha2
Environment: Hibernate 3.6.4 final
Infinispan 5.0.0 CR7
Reporter: raul davidovich
method CacheManagerServiceProvider.createCustomCacheManager calls InfinispanConfiguration.newInfinispanConfiguration(
String configFileName, String schemaFileName, ConfigurationValidatingVisitor cbv);
InfinispanConfiguration configuration = InfinispanConfiguration.newInfinispanConfiguration(
cfgName, InfinispanConfiguration.resolveSchemaPath(),
new ConfigurationValidatingVisitor());
but the Infinispan API does not have this method as of 5.0.0 CR7
the most similar method available in the Infinispan API is InfinispanConfiguration.newInfinispanConfiguration(String configFileName, String schemaFileName, ConfigurationBeanVisitor cbv, ClassLoader cl)
Result is
java.lang.NoSuchMethodError: org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(Ljava/lang/String;Ljava/lang/String;Lorg/infinispan/config/ConfigurationBeanVisitor;)Lorg/infinispan/config/InfinispanConfiguration;
at org.hibernate.ogm.datastore.infinispan.impl.CacheManagerServiceProvider.createCustomCacheManager(CacheManagerServiceProvider.java:126)
at org.hibernate.ogm.datastore.infinispan.impl.CacheManagerServiceProvider.start(CacheManagerServiceProvider.java:80)
at org.hibernate.ogm.metadata.GridMetadataManager.sessionFactoryCreated(GridMetadataManager.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:478)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:142)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 17 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months
[Hibernate-JIRA] Created: (HHH-5844) SQLServer 2008 and latest Microsoft JDBC jar causes exception
by guy bashan (JIRA)
SQLServer 2008 and latest Microsoft JDBC jar causes exception
-------------------------------------------------------------
Key: HHH-5844
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5844
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: guy bashan
Attachments: sqljdbc4.jar
I am working with SQL Server 2008.
I just upgraded to the Microsoft latest JDBC driver: sqljdbc4.jar
I am getting this exception:
org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
org.hibernate.dialect.TypeNames.get(TypeNames.java:78)
org.hibernate.dialect.TypeNames.get(TypeNames.java:103)
org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:328)
org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:590)
org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:516)
org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:532)
org.hibernate.loader.Loader.getResultSet(Loader.java:1962)
org.hibernate.loader.Loader.doQuery(Loader.java:802)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
org.hibernate.loader.Loader.doList(Loader.java:2533)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
com.todacell.ui.model.dao.CampaignDAO.getNetworkCampaigns(CampaignDAO.java:86)
com.todacell.ui.view.bean.campaign.CampaignBrowseListBean$Model.getCampaigns(CampaignBrowseListBean.java:141)
com.todacell.ui.view.bean.campaign.CampaignBrowseListBean$Model.fetchPage(CampaignBrowseListBean.java:91)
com.anydoby.jsfpager.PagedListDataModel.fetchPageInternal(PagedListDataModel.java:152)
com.anydoby.jsfpager.PagedListDataModel.getPage(PagedListDataModel.java:100)
com.anydoby.jsfpager.PagedListDataModel.getWrappedData(PagedListDataModel.java:161)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:140)
org.apache.el.parser.AstValue.getValue(AstValue.java:118)
org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:45)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
javax.faces.component._ComponentUtils.getExpressionValue(_ComponentUtils.java:236)
javax.faces.component.UIComponentBase.getExpressionValue(UIComponentBase.java:1176)
javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1251)
org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276)
org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:250)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
com.todacell.ui.view.filter.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:105)
com.todacell.ui.view.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:61)
--
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
13 years, 4 months
[Hibernate-JIRA] Created: (HHH-6630) Cascading save (JPA merge()) of a transient entity in a UserCollectionType yields duplicate INSERT
by Joachim Breuer (JIRA)
Cascading save (JPA merge()) of a transient entity in a UserCollectionType yields duplicate INSERT
--------------------------------------------------------------------------------------------------
Key: HHH-6630
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6630
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.7, 3.6.6
Reporter: Joachim Breuer
Attachments: UserCollectionDuplicateInsert.tar.bz2
When saving a new (transient) entity by cascading from a JPA merge() operation on its parent, Hibernate will generate [at least] two INSERT statements for the new entity when it is held in a UserCollectionType.
When not specifying a UserCollectionType, the problem does not occur.
The UserCollectionType (for the test case) appears as simple as at all possible, it simply delegates to an ArrayList.
The example/test case attached demonstrates the problem; the HibernateCollectionTest succeeds (and uses a model without the UserCollectionType internally), the UserCollectionTest fails with exactly the same operations, but the UserCollectionType (/jpaSandbox/src/main/java/de/soflimo/sandbox/model/impl/CustomList.java) specified in the mapping.
A few notes about the example:
- I'd expect this to run straightforwardly (using maven).
- I'm not familiar with Hibernate outside of a Spring/JPA context, so that's what the test case uses. Feel free to further simplify the test case.
1. 'getFolderXXX()' at the very top of the Tests returns a (detached) freshly-created, empty Folder instance. The underlying FolderService.createFolderXXX() run in a transaction [configured using Spring] which ends when returning from the createFolderXXX() methods; i.e. the 'folder' instance in the test methods must be thought of as 'detached'.
2. folder.addDocument() modifies the detached folder entity in-memory, by inserting a new (transient) Document entity into its documents collection.
3. save(folder) implemented by FolderService.save() performs a JPA merge() on the detached and modified folder. This, again, is executed within a transaction.
When using the built-in hibernate collection handling, this succeeds; but when specifying the CustomList UserCollectionType in the model mapping, committing this transaction fails because it tries to INSERT [at least] a second row with an identical uniqueKey.
This problem is developing into a blocking issue for us, I'll be happy to try any workarounds and be of further assistance in finding and fixing the cause of this.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 4 months