Envers and Oracle

302 views
Skip to first unread message

Örjan Fjällborg

unread,
May 31, 2012, 7:45:21 AM5/31/12
to nhu...@googlegroups.com
Hi everyone!
 
I just joined this group in hope that my problems with Envers can be fixed.
First of all I wonder if Oracle 10g is supported?
Secondly if it is supported, then I wonder why I got the following DDL script output from SchemaExport:
 
create table REVINFO (
       REV NUMBER(10,0) not null,
       REVTSTMP DateTime,
       primary key (REV)
)
 
Oracle does not like the data type DateTime at all.
I tried to change REVTSTMP manually to TIMESTAMP(4) and skip the schema generation, but then I got a different exception when running unit tests.
 
Best regards:
Örjan Fjällborg

Roger Kratz

unread,
May 31, 2012, 8:26:45 AM5/31/12
to nhu...@googlegroups.com

The short answer…

Yes. Envers should be as database vendor independed as NH Core is.

 

Longer answer…

The test written for Envers was originally only tested against SQL Server. The last week I’ve made the test also run against postgresql and mysql (and done fixes to go all green). Your specific problem with “DateTime” should probably have been fixed in revision https://bitbucket.org/RogerKratz/nhibernate.envers/changeset/a8fe65e872f8. Trunk should be fine for you I guess.

The problem with making sure tests against Oracle works, is simply that I have no license for it. Can you please run all envers tests against an Oracle db and come back with the result?

 

/Roger

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/fs3ZSb6hJsAJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.

Oskar Berggren

unread,
May 31, 2012, 8:34:32 AM5/31/12
to nhu...@googlegroups.com
2012/5/31 Roger Kratz <Roger...@teleopti.com>:

> The problem with making sure tests against Oracle works, is simply that I
> have no license for it. Can you please run all envers tests against an
> Oracle db and come back with the result?

But Oracle is available for free:
http://www.oracle.com/technetwork/products/express-edition/overview/index.html

Then comes the trouble of making the beast actually run of course...

/Oskar

Roger Kratz

unread,
May 31, 2012, 8:37:59 AM5/31/12
to nhu...@googlegroups.com
Yes. I've tried that. The problem for me was simply to get it working in a x64 bits env. Probably just lack of knowledge from my side but I gave it up...

Oskar - maybe I can use NH Core's build server? What db:s are you running your test suits against?
--
You received this message because you are subscribed to the Google Groups "nhusers" group.

Örjan Fjällborg

unread,
May 31, 2012, 12:40:23 PM5/31/12
to nhu...@googlegroups.com
Thank you Roger and Oskar!

I tried the revision Roger suggested and now the REVINFO table seems to be correctly generated in Oracle.

I still get an NullReferenceException from my unit tests, but I have probably used Envers incorrectly.
Stack trace below:

at NHibernate.Envers.Event.AuditEventListener.OnPostInsert(PostInsertEvent evt) in C:\Download\RogerKratz-nhibernate.envers-a8fe65e872f8\RogerKratz-nhibernate.envers-a8fe65e872f8\Src\NHibernate.Envers\Event\AuditEventListener.cs:line 104
at NHibernate.Action.EntityInsertAction.PostInsert() in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Action\EntityInsertAction.cs:line 133
at NHibernate.Action.EntityInsertAction.Execute() in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Action\EntityInsertAction.cs:line 96
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable) in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Engine\ActionQueue.cs:line 136
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list) in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Engine\ActionQueue.cs:line 126
at NHibernate.Engine.ActionQueue.ExecuteActions() in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Engine\ActionQueue.cs:line 169
at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session) in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Event\Default\AbstractFlushingEventListener.cs:line 241
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Event\Default\DefaultFlushEventListener.cs:line 19
at NHibernate.Impl.SessionImpl.Flush() in c:\Users\oskar.berggren\Documents\Projects\nhibernate-core-3\src\NHibernate\Impl\SessionImpl.cs:line 1499
at IM.NHibernateUnitOfWork.UnitOfWork.TransactionalFlush() in C:\Div\IM\IM\NHibernateUnitOfWork\UnitOfWork.cs:line 147
at DomainTest.HopperRepository_Fixture.CreateInitialData() in C:\Div\IM\DomainTest\HopperRepository_Fixture.cs:line 142
at DomainTest.HopperRepository_Fixture.MyTestInitialize() in C:\Div\IM\DomainTest\HopperRepository_Fixture.cs:line 75

Best regards
/Örjan

Roger Kratz

unread,
May 31, 2012, 1:37:53 PM5/31/12
to nhu...@googlegroups.com
Can you please run envers' test suite (envers source code I mean) and see which tests fails?


________________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] f&#246;r Örjan Fjällborg [orjan.f...@gmail.com]
Skickat: den 31 maj 2012 18:40
Till: nhu...@googlegroups.com
Ämne: Re: [nhusers] Envers and Oracle
--
You received this message because you are subscribed to the Google Groups "nhusers" group.

Örjan Fjällborg

unread,
Jun 1, 2012, 6:46:02 AM6/1/12
to nhu...@googlegroups.com
Hi!
 
I had some work to get the Envers test suite up and running, but now the tables are generated in the database.
 
I start with the first test failing: FieldAccessTest line 43:
Assert.AreEqual(ver1, AuditReader().Find<FieldAccessEntity>(id, 1));

 

AuditReader returns null!

All looks good in the Oracle tables FIELDACCESSENTITY and even in FIELDACCESSENTITY_AUD:

ID REV REVTYPE DATA

1 2 0 first
1 3 1 second

Best regards

/Örjan

Roger Kratz

unread,
Jun 1, 2012, 7:31:55 AM6/1/12
to nhu...@googlegroups.com

Thanks.

 

I will try to setup an Oracle db somehow to be able to fix your issue(s). (few days, weeks – don’t know unfortunately)

--

You received this message because you are subscribed to the Google Groups "nhusers" group.

To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/cK54VrT3nm0J.

Örjan Fjällborg

unread,
Jun 1, 2012, 9:07:02 AM6/1/12
to nhu...@googlegroups.com
Hi Roger!
 
I found out that the revision number starts at 2 when I run against Oracle!
Changeing the FieldAccessTest.VerifyHistory to use revision 2 and 3 makes the first test pass.
 
Best regards
/Örjan

Roger Kratz

unread,
Jun 1, 2012, 5:33:47 PM6/1/12
to nhu...@googlegroups.com

I finally got Oracle up and running in my environment.

 

Will hopefully find time to fix Oracle issues pretty soon. Added a new JIRA issue for this

https://nhibernate.jira.com/browse/NHE-78

 

 

From: nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] On Behalf Of Örjan Fjällborg
Sent: den 1 juni 2012 15:07
To: nhu...@googlegroups.com
Subject: Re: [nhusers] Envers and Oracle

 

Hi Roger!

--

You received this message because you are subscribed to the Google Groups "nhusers" group.

To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/6_gsqjM0J_0J.

Roger Kratz

unread,
Jun 4, 2012, 5:27:58 AM6/4/12
to nhu...@googlegroups.com

Envers (latest trunk) should now work fine against Oracle.

 

If you find any issues, please report them to the JIRA with a failing test.

 

From: nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] On Behalf Of Örjan Fjällborg
Sent: den 1 juni 2012 15:07
To: nhu...@googlegroups.com
Subject: Re: [nhusers] Envers and Oracle

 

Hi Roger!

--

You received this message because you are subscribed to the Google Groups "nhusers" group.

To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/6_gsqjM0J_0J.

Örjan Fjällborg

unread,
Jun 4, 2012, 7:25:18 AM6/4/12
to nhu...@googlegroups.com
Thank you Roger!
 
I'm really impressed of the speed, service and knowledge in this user group! I have never experienced anything near this when it comes to software support.
 
I also learned how to run the unit tests for Envers which is great for studying how it should be used.
 
Best regards
/Örjan
Reply all
Reply to author
Forward
0 new messages