Comments (7)
I explain what happened
nhibernate/nhibernate-core#2913
from nhibernate-envers.
Can you write a failing test? Or at least show some minimal mapping to recreate the issue?
from nhibernate-envers.
I use test from NHibernate.Envers.Tests.Integration.EntityNames.SingleAssociatedAudited.ReadEntityAssociatedAuditedTest
Change mapping (add lazy everywhere)
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="NHibernate.Envers.Tests"
namespace="NHibernate.Envers.Tests.Integration.EntityNames.SingleAssociatedAudited">
<class name="Person" entity-name="Personaje" table ="OWNERS">
<id name="Id" column="ID_PERSON" type="long" >
<generator class="native" />
</id>
<property name="Name" type="string" length="255"
column="NAME" not-null="true" lazy="true" />
<property name="Age" type="int" lazy="true" column="AGE"/>
</class>
<!-- Deliberately use the same domain object and map it to a different database table. See issue HHH-4648. -->
<class name="Person" entity-name="Driveraje" table ="DRIVERS">
<id name="Id" column="ID_PERSON" type="long" >
<generator class="native" />
</id>
<property name="Name" type="string" length="255"
column="NAME" not-null="true" lazy="true" />
<property name="Age" type="int" column="AGE" lazy="true"/>
</class>
<class name="Car" >
<id name="Id" column="ID_CAR" type="long">
<generator class="native" />
</id>
<property name="Number" type="int" not-null="true" column="numb" lazy="true"/>
<many-to-one name="Owner" entity-name="Personaje"/>
<many-to-one name="Driver" entity-name="Driveraje"/>
</class>
</hibernate-mapping>
And change Test initialize (add reference to exists item)
protected override void Initialize()
{
var pers1 = new Person { Name = "Hernan", Age = 15 };
var pers2 = new Person { Name = "Leandro", Age = 19 };
var car1 = new Car {Number = 1, Owner = pers1};
var car2 = new Car {Number = 2, Owner = pers2};
//rev 1
using (var tx = Session.BeginTransaction())
{
id_pers1 = (long) Session.Save("Personaje", pers1);
id_car1 = (long) Session.Save(car1);
tx.Commit();
}
//rev 2
using (var tx = Session.BeginTransaction())
{
pers1.Age = 50;
id_pers2 = (long) Session.Save("Personaje", pers2);
id_car2 = (long) Session.Save(car2);
tx.Commit();
}
Session.Clear();
// THIS IS THE BUG LOGIC
using (var tx = Session.BeginTransaction())
{
var pp = Session.Query<Person>().Where(x => x.Id == id_pers1).SingleOrDefault();
var car3 = new Car { Number = 3, Owner = pp };
Session.Save(car3);
tx.Commit();
}
}
No persister for: PersonProxyForFieldInterceptor
from nhibernate-envers.
Most probably same issue as https://hibernate.atlassian.net/browse/HHH-13760.
Can you please create a PR where you've simplify above example as much as possible and created a new failing test for it?
from nhibernate-envers.
@RogerKratz
Pull request with test for bug reproducing
#38
from nhibernate-envers.
See possible fix nhibernate/nhibernate-core#2913 (comment)
from nhibernate-envers.
fixed
from nhibernate-envers.
Related Issues (20)
- New release with fix #16 HOT 1
- Incorrect audit table insert on tables with tree structure HOT 4
- Unexpected session flush when calling AuditReader.GetCurrentRevision HOT 1
- Running into problem with table per class mapping with multiple subclasses HOT 3
- NullReferenceException when many-to-many relation with the same key name as backreference HOT 1
- NullReferenceException on AuditEventListener HOT 11
- Build Warning with new NHibernate 5.3 package HOT 2
- Envers in Db2 invalid cast HOT 7
- Error retrieving Geography column with msql server HOT 4
- Missing Docs HOT 6
- Extend modified flags to support track changes within components HOT 8
- CreateQuery(…).ExecuteUpdate() HOT 1
- GetCurrentTransaction is null HOT 2
- Make MySql build green HOT 1
- Make Firebird build green HOT 1
- Make Oracle build green HOT 1
- Field marked as Generated.Insert not being audited HOT 5
- envers transaction´
- True async suppport HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhibernate-envers.