[Hibernate-JIRA] Created: (HV-445) Ensure meta models are completely unmodifiable
by Gunnar Morling (JIRA)
Ensure meta models are completely unmodifiable
----------------------------------------------
Key: HV-445
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-445
Project: Hibernate Validator
Issue Type: Improvement
Reporter: Gunnar Morling
Fix For: 4.2.0.CR1
The internal meta model (BeanMetaDataImpl et al.) as well as the external one (BeanDescriptorImpl et al.) should be completely unmodifiable, as they could potentially be accessed from multiple threads at the same time.
I made some more fields final/unmodifiable with HV-371, but there are some places left which I couldn't change easily and need some more consideration:
* ConstraintDescriptorImpl#compositionType
* ElementDescriptorImpl#constraintDescriptors
* BeanMetaDatImpl#cascadedMembers (could be made unmodifiable after initialization instead of creating a new unmodifiable set with each call of getCascadedMembers()
When looking through the model I found it quite complex to find out which collection fields are already unmodifiable and which not. I therefore thought about introducing a marker annotation @Unmodifiable which could be used to document unmodifiable fields. WDYT?
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-7017) Envers does not work in case of resource-local transactions and manual session flush mode
by Vladimir Velikiy (JIRA)
Envers does not work in case of resource-local transactions and manual session flush mode
-----------------------------------------------------------------------------------------
Key: HHH-7017
URL: https://hibernate.onjira.com/browse/HHH-7017
Project: Hibernate ORM
Issue Type: Bug
Components: envers
Affects Versions: 3.6.9
Environment: Hibernate 3.6.9, MySQL 5.1.44-community, mysql-connector-java-5.1.6, Inno DB tables
Reporter: Vladimir Velikiy
When I set a manual hibernate session flush mode envers does not write data in database. With FlushMode.AUTO all works ok. I think the problem in in a method doBeforeTransactionCompletion of the AuditProcess.java:
if (FlushMode.isManualFlushMode(session.getFlushMode())) {
Session temporarySession = null;
try {
temporarySession = session.getFactory().openTemporarySession();
executeInSession(temporarySession);
temporarySession.flush();
} finally {
if (temporarySession != null) {
temporarySession.close();
}
}
} else {
executeInSession((Session) session);
// Explicity flushing the session, as the auto-flush may have already happened.
session.flush();
}
In non-jta environment temporary session connection transaction is not commited.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-4962) @ManyToOne with @JoinTable fails
by Clint Popetz (JIRA)
@ManyToOne with @JoinTable fails
--------------------------------
Key: HHH-4962
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4962
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.2
Reporter: Clint Popetz
$ cat src/main/java/test/User.java
package test;
import javax.persistence.*;
import org.hibernate.envers.Audited;
import java.util.Set;
The below code fails with "org.hibernate.MappingException: Unable to read the mapped by attribute for widgets in test.User!" but is supported by JPA, at least under hibernate.
@Entity
@Audited
public class User
{
@Id
private long id;
@OneToMany(mappedBy="user")
private Set<Widget> widgets;
}
$ cat src/main/java/test/Widget.java
package test;
import javax.persistence.*;
import org.hibernate.envers.Audited;
@Entity
@Audited
public class Widget
{
@Id
private long id;
@ManyToOne(fetch=FetchType.LAZY)
@JoinTable(name = "widget_to_user",
joinColumns = @JoinColumn(name = "widget_id"),
inverseJoinColumns = @JoinColumn(name = "user_id"))
private User user;
}
--
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, 1 month