[Hibernate-JIRA] Created: (HV-495) Many locks on AnnotatedElements
by Loïc DIAS DA SILVA (JIRA)
Many locks on AnnotatedElements
-------------------------------
Key: HV-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-495
Project: Hibernate Validator
Issue Type: Patch
Components: validators
Affects Versions: 4.2.0.CR1
Environment: GNU/Linux, JVM 6.0, Hibernate Validator 4.2.0.CR1
Reporter: Loïc DIAS DA SILVA
Attachments: jmeter-graph.docx, patch-ldds.patch
Hi all, we use Hibernate Validator 4.2.0-CR1 (previously Apache BVAL) for one of our API projects.
All is working fine for our needs except one big issue recently discovered during JMeter tests.
Several injectors make many requests from some Amazon cloud servers to our API and starting from a number of requests the response time begins to increase eavily, making a big jump from about 100ms in average to more than 5s.
After investigating we have seen many locks in some AnnotatedElement methods (mainly getAnnotation).
I've then made a little patch on hibernate in order to cache this kind of requests as i've not found any other cleaver/yet implemented way..
Since this patch all is working very well for us..
Regards.
--
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
12 years, 8 months
[Hibernate-JIRA] Created: (HHH-6790) Add option to SequenceStyleGenerator to prefer a "sequence per entity"
by Steve Ebersole (JIRA)
Add option to SequenceStyleGenerator to prefer a "sequence per entity"
-----------------------------------------------------------------------
Key: HHH-6790
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6790
Project: Hibernate Core
Issue Type: New Feature
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Fix For: 4.1.0
Basically this is a RFE for a corollary to {{org.hibernate.id.enhanced.TableGenerator#CONFIG_PREFER_SEGMENT_PER_ENTITY}} for the {{org.hibernate.id.enhanced.SequenceStyleGenerator}}.
Currently, when no sequence name is given the default name (hibernate_sequence) is used. So this option would force {{org.hibernate.id.enhanced.SequenceStyleGenerator}} to determine a sequence name when none is explicitly given based on the name of the entity. The logic would be very similar to {{org.hibernate.id.enhanced.TableGenerator#determineDefaultSegmentValue}} but leveraging {{org.hibernate.id.IdentifierGenerator#ENTITY_NAME}} instead of {{org.hibernate.id.PersistentIdentifierGenerator#TABLE}}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[Hibernate-JIRA] Created: (HHH-7003) Scale = 0 doesn't supported
by R. Gainullin (JIRA)
Scale = 0 doesn't supported
---------------------------
Key: HHH-7003
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-7003
Project: Hibernate ORM
Issue Type: Bug
Components: envers
Affects Versions: 4.0.1
Reporter: R. Gainullin
If Audited entity consist Column with scale equals zero than Revision table create column with default scale value
Entity class:
@Entity
@Audited
public class Ent {
@Column(scale=0,precision=20)
private BigInteger field1;
....
}
For Postresql revision table:
Table Ent_AUD{
field1 numeric(20, 2)
}
Probably error in file
org.hibernate.envers.configuration.metadata.MetadataTools.java
in method
public static Element addColumn(...) {
...
if (scale != 0) {
column_mapping.addAttribute("scale", Integer.toString(scale));
}
...
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[Hibernate-JIRA] Created: (HHH-7101) NPE when trying to create EntityManagerFactory
by Michael Nascimento Santos (JIRA)
NPE when trying to create EntityManagerFactory
----------------------------------------------
Key: HHH-7101
URL: https://hibernate.onjira.com/browse/HHH-7101
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.0
Environment: hibernate-jpa-2.0-api:1.0.1-Final; hibernate-core:4.1.0.Final; hibernate-entitymanager:4.1.0.Final
Reporter: Michael Nascimento Santos
Attachments: npe4cacheable.zip
A NPE is thrown for a simple pure JPA entity annotated with @Cacheable as follows:
@Entity
@Cacheable
public class SampleEntity {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
}
When Persistence.createEntityManagerFactory(String) is called and such entity is part of the persistence unit, this produces:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at org.hibernate.annotations.CacheConcurrencyStrategy.fromAccessType(CacheConcurrencyStrategy.java:52)
at org.hibernate.cfg.AnnotationBinder.determineCacheConcurrencyStrategy(AnnotationBinder.java:1044)
at org.hibernate.cfg.AnnotationBinder.buildCacheMock(AnnotationBinder.java:1011)
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:968)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:577)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3431)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3385)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1337)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1727)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:88)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at org.hibernate.test.npe4cacheable.SampleEntity.main(SampleEntity.java:18)
... 6 more
Hibernate should either choose some sensible default strategy or produce a clear message indicating the need to set one manually.
Attached is a Maven-powered sample with Derby that can be executed with exec:java .
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-5160) Error on binding values prepared statment in many-to-any relation
by wof (JIRA)
Error on binding values prepared statment in many-to-any relation
-----------------------------------------------------------------
Key: HHH-5160
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5160
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.1, 3.3.2
Environment: Tested on Version 3.3.2 and 3.5.1 on Oracle, PostgreSQL and MySQL
Reporter: wof
A Collection of Entities is defined as a ManyToAny relation, e.g.
@ManyToAny(metaColumn=@Column(name="C_OBJECT_TYPE"))
@AnyMetaDef(idType="string", metaType="string",
metaValues={
@MetaValue(targetEntity=Entity1.class, value="Entity1"),
@MetaValue(targetEntity=Entity2.class, value="Entity2")
})
@JoinTable(name="T_OBJECTS",
joinColumns=@JoinColumn(name="C_OWNER_ID"),
inverseJoinColumns=@JoinColumn(name="C_OBJECT_ID")
)
private Set<EntityBase> objects = new HashSet<EntityBase>();
Adding to this set works without problems. Removing all elements from the set (i.e. setting the set to null or zero-sized), too. However, when one or more elements are removed from the set with at least one element remaining, an exception is thrown:
org.hibernate.exception.GenericJDBCException: could not delete collection rows with the cause being java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).
I have narrowed this problem to this: The mapping table consists of 3 columns, C_OWNER_ID, C_OBJECT_TYPE and C_OBJECT_ID. The generated SQL-statement to delete the rows is as folling:
DELETE FROM t_objects WHERE c_owner_id=? AND c_object_id=?
However, Hibernate (in org.hibernate.typ.AnyType) tries to bind the actual value for c_object_id with index 3 which causes the exception. I guess Hibernate expects c_object_type to be present in the statement.
As workaround we changed nullSafeSet in AnyType to:
public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session)
throws HibernateException, SQLException {
Serializable id;
String entityName;
if (value==null) {
id=null;
entityName=null;
}
else {
entityName = session.bestGuessEntityName(value);
id = ForeignKeys.getEntityIdentifierIfNotUnsaved(entityName, value, session);
}
// metaType is assumed to be single-column type
// <ORIGINAL CODE>
/*
if ( settable==null || settable[0] ) {
metaType.nullSafeSet(st, entityName, index, session);
}
if (settable==null) {
identifierType.nullSafeSet(st, id, index+1, session);
}
else {
boolean[] idsettable = new boolean[ settable.length-1 ];
System.arraycopy(settable, 1, idsettable, 0, idsettable.length);
identifierType.nullSafeSet(st, id, index+1, idsettable, session);
}
*/
// </ORIGINAL CODE>
// <PATCHED CODE>
if ( settable==null || settable[0] ) {
metaType.nullSafeSet(st, entityName, index, session);
boolean[] idsettable = new boolean[ settable.length-1 ];
System.arraycopy(settable, 1, idsettable, 0, idsettable.length);
identifierType.nullSafeSet(st, id, index+1, idsettable, session);
}
else if (settable==null) {
identifierType.nullSafeSet(st, id, index+1, session);
}
else {
boolean[] idsettable = new boolean[ settable.length-1 ];
System.arraycopy(settable, 1, idsettable, 0, idsettable.length);
identifierType.nullSafeSet(st, id, index, idsettable, session);
}
// </PATCHED CODE>
}
best regards
wof
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-7074) The annotation of @DynamicUpdate has no effect
by zhuzhangsuo (JIRA)
The annotation of @DynamicUpdate has no effect
----------------------------------------------
Key: HHH-7074
URL: https://hibernate.onjira.com/browse/HHH-7074
Project: Hibernate ORM
Issue Type: Bug
Components: annotations
Affects Versions: 4.1.0
Environment: hibernate 4.1.0 mysql 5.1
Reporter: zhuzhangsuo
The annotation org.hibernate.annotations.Entity has deprecated ,and it suggest to use @DynamicUpdate to instead of the property dynamicUpdate ,but it has no effect
when I modify the value of name
The sql of @org.hibernate.annotations.Entity(dynamicUpdate=true): update t_user set user_name=? where user_id=?
The sql of @DynamicUpdate: update t_user set user_age=?, user_name=? where user_id=?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months