NHibernate in Medium Trust

79 views
Skip to first unread message

Sam Kimmel

unread,
Jul 15, 2009, 4:35:10 PM7/15/09
to nhusers
Just started with NHibernate about a week and a half ago. Was hoping
to use it for the backbone of a project I am working on but
immediately ran into issues in Medium Trust (target audience for my
application). I was about to give up on it and go to SubSonic until I
found a post by Martijn Boland (http://blogs.taiga.nl/martijn/
2009/06/24/new-adventures-under-medium-trust/) over at the cuyahoga
project (http://www.cuyahoga-project.org/).

He reportedly was able to get NHibernate+Castle to work in Medium
Trust, and best of all it supports lazy loading. He submitted a patch
to Castle which they quickly applied, but unfortunately, I am using VS
Express versions so I couldn't open the NHibernate project and
recompile it with the updated library dependencies. However, I was
able to download the modified libraries from the cuyahoga SVN (https://
cuyahoga.svn.sourceforge.net/svnroot/cuyahoga/trunk). Replaced all of
the original DLLs with the new ones (Castle.Core.dll,
Castle.DynamicProxy2.dll, Iesi.Collections.dll, log4net.dll,
NHibernate.dll, NHibernate.ByteCode.Castle.dll) and Shazaam!!!

You'll still need to add <reflection-optimizer use="false" /> to the
config for hosts that don't allow reflection, but at least your apps
will work.

I'm 99.9% sure that NHibernate has lost potential developers because
of this (it almost lost me and probably would have if I didn't find
Martijn's blog entry). I suggest someone with commit rights look at
what was done and get this up in the downloadable zip on the front
page, pronto!

Have a good one!
Sam

Fabio Maulo

unread,
Jul 15, 2009, 7:02:54 PM7/15/09
to nhu...@googlegroups.com
2009/7/15 Sam Kimmel <swee...@gmail.com>

I'm 99.9% sure that NHibernate has lost potential developers because
of this (it almost lost me and probably would have if I didn't find
Martijn's blog entry). 

I'm sure you read NH-forge wiki and some others blog posst about how use NH in medium-trust.
The 67000 downloads of NH is because there are many silly developers using NH to play a little bit with something completely unusable.

By the way, for tonight, we all will take an Alplax to sleep a bit because we are worried if you will go for something else than NH.

I want give you a cache to learn a little bit:

--
Fabio Maulo

Fabio Maulo

unread,
Jul 15, 2009, 7:35:46 PM7/15/09
to nhu...@googlegroups.com
2009/7/15 Sam Kimmel <swee...@gmail.com>

  Replaced all of
the original DLLs with the new ones (Castle.Core.dll,
Castle.DynamicProxy2.dll, Iesi.Collections.dll, log4net.dll,
NHibernate.dll, NHibernate.ByteCode.Castle.dll) and Shazaam!!!

If you want work with Castle.DynamicProxy2 trunk you only need to recompile NHibernate.ByteCode.Castle using the trunk of Castle.Core and Castle.DynamicProxy2.
Deployed NHibernate.ByteCode.Castle is compiled with the last available version of Castle dynamicproxy.
"and Shazaam!!!"

You don't need to recompile NHibernate nor Iesi.Collection (for something the ProxyFactory was removed from the core of the core)

Next time try to ask help instead write not useful comments dictated by ignorance (I mean: because you are ignoring there are more than one solutions to your "problem").

--
Fabio Maulo

Josh Rogers

unread,
Jul 15, 2009, 7:41:34 PM7/15/09
to nhu...@googlegroups.com
All he was trying to do is make a valid suggestion, while it may have been boisterous, I do not understand the irradic  barrage of belittiling comments and answers from you Fabio.  There is no one that will say the learning curve for NH is anything less than steep, yet you treat question posers with hostility and disrespect.  I have been nothing but respectful of you and your contributions yet you gave me the same flippant attitude as you gave this person.

Being part of an open source project, not to mention the lead developer, automattically places you in a position of spokesperson for that project.  Whether that is what you want or not that is the truth.  

I am sure I won't be missed either but I will not be using NH anymore nor will I consider it for future products while this type of attitude prevails in the project.   

Fabio Maulo

unread,
Jul 15, 2009, 8:23:32 PM7/15/09
to nhu...@googlegroups.com
Which was the suggestion ?
Which was my "disrespect" ?

The attitude of a question may influence the attitude of the answer.
The net is free and each one can write his opinion with his personality and I know that I'm not a good political.
The list may have one or more moderators and perhaps they will write me something.
Btw, both response does contain the answer to the problem

If you felt bad by my answer, I'm sorry.



2009/7/15 Josh Rogers <joshl...@gmail.com>



--
Fabio Maulo

Markus Zywitza

unread,
Jul 16, 2009, 12:45:31 AM7/16/09
to nhu...@googlegroups.com
Oh it might be that when you are working on your spare time on such a project, you won't be too happy when someone comes and tells you to do something "pronto".

If you also look at the reason, that he can't compile NH because of having VS Express, then all you know is that the person in question is not able to read howtobuild.txt or readme.txt or whatever. All you need to build NH is the SDK and NAnt.

-Markus

2009/7/16 Josh Rogers <joshl...@gmail.com>

Stefan Steinegger

unread,
Jul 16, 2009, 8:28:30 AM7/16/09
to nhusers
Indeed. Fabios answer might be emotional (I found it funny by the
way). But Sams post is just ridiculous. Working since "one and a half"
week with NH and demanding binaries including a certain feature
"pronto"?? Fabio just points out what scale this project has, how many
people already depend on in and that features aren't requested this
way.

On 16 Jul., 06:45, Markus Zywitza <markus.zywi...@gmail.com> wrote:
> Oh it might be that when you are working on your spare time on such a
> project, you won't be too happy when someone comes and tells you to do
> something "pronto".
>
> If you also look at the reason, that he can't compile NH because of having
> VS Express, then all you know is that the person in question is not able to
> read howtobuild.txt or readme.txt or whatever. All you need to build NH is
> the SDK and NAnt.
>
> -Markus
>
> 2009/7/16 Josh Rogers <joshlrog...@gmail.com>
>
> > All he was trying to do is make a valid suggestion, while it may have been
> > boisterous, I do not understand the irradic  barrage of belittiling comments
> > and answers from you Fabio.  There is no one that will say the learning
> > curve for NH is anything less than steep, yet you treat question posers with
> > hostility and disrespect.  I have been nothing but respectful of you and
> > your contributions yet you gave me the same flippant attitude as you gave
> > this person.
>
> > Being part of an open source project, not to mention the lead developer,
> > automattically places you in a position of spokesperson for that project.
> >  Whether that is what you want or not that is the truth.
>
> > I am sure I won't be missed either but I will not be using NH anymore nor
> > will I consider it for future products while this type of attitude prevails
> > in the project.
>
> > On Jul 15, 2009, at 6:02 PM, Fabio Maulo <fabioma...@gmail.com> wrote:
>
> > 2009/7/15 Sam Kimmel < <sweep...@gmail.com>sweep...@gmail.com>
>
> >> I'm 99.9% sure that NHibernate has lost potential developers because
> >> of this (it almost lost me and probably would have if I didn't find
> >> Martijn's blog entry).
>
> > I'm sure you read NH-forge wiki and some others blog posst about how use NH
> > in medium-trust.The 67000 downloads of NH is because there are many silly

Josh Rogers

unread,
Jul 16, 2009, 9:46:15 AM7/16/09
to nhu...@googlegroups.com
I went back and read Sam's post to, in fact, make sure that I did not
overreact. Given that the justification given by both of you is that
he purportedly demanded to have this fix put in place is a bit far
fetched. I believe you're giving the term "pronto" far too much
reverence. He got excited and thought it would be prudent, which I am
of the opinion that we need more people excited about open source
projects, to inform the developers of an issue he encountered and that
he was able to find a solution and thought it would lend value to the
NH project and its 67,000 downloaders. Yes, I entirely concede that
he got overly excited, but my god people it could just be his
personality. He was by no means stomping up and down demanding that
you make the change now, you could just as easily rewrite his
statement as such:

Judging by my experience I'm assuming that NH has lost potential
developers because
of this. I would recommend that someone with commit rights look at
Martijn's blog post and get this up in the downloadable zip on the front
page. Hopefully this could be done fairly quickly in hopes of helping
others out there that may be encountering the same issue!

This has the exact same meaning. It is also valid to point out that
the word Pronto is not usually used, in American English at least, as
a forceful demand of expedience. It is typically a more light hearted
phrase, in fact I have never encountered anyone that has used it in
such a manner as how it is being interpreted here. While this all may
be semantics, had he said "I suggest someone with commit rights look
at what was done and get this up in the downloadable zip on the front
page, now!" then I would be in the exact same boat as all of you.
That is not what he said and it still begs the question why it was
justifiable to retort with a sarcastic hubris remark such as "By the
way, for tonight, we all will take an Alplax to sleep a bit because we
are worried if you will go for something else than NH." Disregarding
the rest of the his response, the tone and under current of disdain in
this mere statement is equivalent to just saying "We don't really give
a shit whether you use the product or not, so shut up and move on."

So, in closing, Fabio's contributions to NH are greatly appreciated.
I still respect him highly for not only his contributions to NH and
the open source community but also his skill as a developer that is
quite evident through the source and through his blog. I, also, know
that he can be very helpful when he is so inclined. He, however, is a
voice and being the lead developer that voice is a bit louder than
everyone else, for better or for worse. That means when he gives
these short hubristic remarks as he has done with Sam. Or he responds
to someone with one word answers or links to the NH reference manual
rather than explaining an issue as he has done with me, he is setting
a very negative tone for the entire project. One of the main reasons
that NH has such a huge learning curve is that the documentation is
quite lacking in substance. This is not saying anything bad, as this
is quite often the case with open source projects, but it means that
more people with varied skill levels and personalities are going to
find their way to the user groups and post what may seem like trivial
questions but to them it is very challenging. I would rather see
someone who thinks answering those questions is a waste of time just
not bother with answering versus giving the types of remarks we have
seen.

I apologize for the long response. I, unfortunately, see this happen
all too often in open source projects and honestly is a limiting
factor of open source projects and their proliferation IMHO.

Thanks for your time.

Markus Zywitza

unread,
Jul 16, 2009, 9:58:13 AM7/16/09
to nhu...@googlegroups.com
When the issue is quite clear from the docs, as it was the case in your question, why should he explain again? As for the docs quality, are we talking on the same project? Did you try to find docs for NServiceBus once?
 
If you need a more gentle introduction than the doc reference, you can always by the Manning book. I had to go through the Manning Hibernate (Java) book, but even this shows how to solve common NH problems.

And using "pronto" in german means: DO IT RIGHT NOW AND CALL ME SIR! (capitalization intended)
 
2009/7/16 Josh Rogers <joshl...@gmail.com>

Fabio Maulo

unread,
Jul 16, 2009, 10:17:49 AM7/16/09
to nhu...@googlegroups.com
I'll try to explain again what Martijn have said in his blog.

Martijn don't want use something as NHPG and that is his own election.
He found a problem in Castle.DynamicProxy2, he sent the description of the problem and a patch to Castle project. The patch was accepted and applied (quickly as usual) and is available in Castle.DynamicProxy2 trunk (was not released, so far).
NOTE : There is no problem in NH.

Sam wrote me a private mail and he understood which is the real problem and which are possible solutions.
To resume the solutions are:
1) use NHPG
2) download SVN version of Castle.Core and Castle. DynamicProxy2, download sources of NHibernate.ByteCode.Castle project related to the version of NH you are using, compile Castle, copy the 2 dll in Lib of NH and compile only NHibernate.ByteCode.Castle project.

That's all.

P.S. Josh, when I will have a problem a will contact you as my lawyer.

2009/7/16 Josh Rogers <joshl...@gmail.com>



--
Fabio Maulo

Josh Rogers

unread,
Jul 16, 2009, 10:18:42 AM7/16/09
to nhu...@googlegroups.com
"When the issue is quite clear from the docs"

See, there ya go. To me it wasn't clear, still isn't thus why I asked
the question. There is a saying "You don't understand it until you
do." This encompasses software development so perfectly. Think of so
many developers who struggle with learning OOP, you struggle endlessly
until you reach that aha! moment then you don't understand why it was
so hard to understand. You must have struggled with something along
those lines in your career, so maybe a little sympathy would go a good
distance. If not, at least be empathetic because we are not all l337
programmers.

"As for the docs quality, are we talking on the same project? Did you
try to find docs for NServiceBus once?"

Are you serious? I clearly stated that this is not saying anything
bad about NH as MOST OPEN SOURCE PROJECTS SUFFER THE SAME LACK OF
DOCUMENTATION. I am not going to get in a "Oh yeah, well this one is
even worse...." argument as it would be fruitless.

"And using "pronto" in german means: DO IT RIGHT NOW AND CALL ME SIR!"

So, you didn't take the time to consider his name, his grammar, and
his usage of language to reach a fairly confident level of certainty
that he is American? I don't know if he is American or not, but from
what I could tell I would assume he is. Also, not knowing his origin
is even more reason to give leeway since words OBVIOUSLY
(capitalization intended) have different inferences in different
cultures and languages.

I really don't want this to turn into a pissing match. I also don't
intend for any of you to consider me as attacking NH or you as an
individual. I will tell you now that it is not my intention nor
desire to insult or call into question any of your abilities or
ethics. I just feel it is important to keep a level of understanding
in the open source community that by its own nature of being free and
open to manipulation by developers you will be inviting all types and
skill levels to use the product and ask questions. Finally, giving
equal respect to all of those individuals will further the open source
initiatives everywhere and despite all of this I truly believe you all
want that otherwise you wouldn't be contributing to NH.

Markus Zywitza

unread,
Jul 16, 2009, 10:29:21 AM7/16/09
to nhu...@googlegroups.com
What I meant is that NH doesn't suffer from lack of documentation:
This document http://nhforge.org/doc/nh/en/index.html tells you everything you need to know.
Not even to speak of Ayende's and Fabio's and Gabriel's blog posts...
 
2009/7/16 Josh Rogers <joshl...@gmail.com>

Fabio Maulo

unread,
Jul 16, 2009, 10:33:39 AM7/16/09
to nhu...@googlegroups.com
Unfortunatelly I haven't wrote that part in the docs.
Btw



--
Fabio Maulo

Sam Kimmel

unread,
Jul 16, 2009, 10:40:35 AM7/16/09
to nhusers
Group, I sent an email directly to Fabio last night to avoid further
bickering on the list hoping that the topic would just die.
Unfortunatley, the nature of the web is to allow things to live on
long past their time (which is part of the reason this topic came to
be--most of the documentation I found for Medium Trust encouraged
disabling lazy loading or finding a host that allows reflection).
Fabio and I both consider the issue resolved and hope you can too.

This is our exchange...

================

Sorry, it was probably innappropriate for me to jump on the list and
post my solution given my inexperience with the project, but I was
excited to finally have it working after several hours of frustration.

I did use Google, which is how I found Martijn's post. The problem
with the 10,800 Google results was that I had to sift through half of
them to find one that allowed me to run in partial trust and use lazy
loads. If it is so blatantly obvious, then why do so many of those
10,800 pages end up with someone suggesting that people change hosts
to one that allows reflection, or saying that the only way is to
disable lazy loading? Even most of the discussions I found in the
Forge said disable lazy loading.

Of course, now having read your informative comments, I realize that I
don't even need Castle and can simply use the NHibernate
ProxyGenerators. I actually came across it a couple days ago, but
wasn't sure if it was ready for prime time with only 1,900 downloads
and still being listed as being beta (not to mention the most previous
comment on the blog post was from October 2008). I had at least heard
of Castle and figured it was trustworthy. I'll be trying the
ProxyGenerators tonight.

Lastly, in response to the tone of your comments, may I direct you to
your post on the front page of the Forge (http://nhforge.org/content/
WelcomeMessage.aspx). You yourself talk about how scattered the
documentation for the project and it's contributions are. You also
talk about the Forge being "a place to have a cohesive community
working together." At the time I thought I was contributing to the
project and helping people out--I didn't expect to get jumped on by a
project developer (which, based on your responses, I assume is because
you took my last paragraph as an attack rather than a suggestion to
grow the community).

Now, off to get a glass of water and an Alplax so I can get some
rest :) [this is meant as a joke and not scarcasm]

Thank you for pointing me in the right direction on the
ProxyGenerators.

=================

And his response...

If you want work with Castle trunk you must download Castle sources
(via SVN), compile it in your box, copy Castle.Core and
Castle.DynamicProxy2 in the lib of NH's sources and compile
NHibernate.Bytecode.Castle (now is easy because I have removed the
circular reference with castle project).

A way to help the community is do something for it. When you have your
work done you can write a blog-post or contribute something in the NH-
Forge's wiki, or even more simply (but less persistent) send an e-mail
to the nhusers list.
Perhaps a blog post titled "NHibernate working in Medium Trust" would
be better indexed by google.
If you want share your experience in NH-Forge let me know.

Now that you know nhusers-list, you know which is the right place
where ask a question about a problem with NH use... better if you will
do it before feel frustrated ;)

Now I can go to sleep without get an Alplax because you are back as
NH's user. LOL

=================

And by the way, I am not German...well, I guess I'm 1/8th:) I didn't
think I was demanding anything--I was suggesting it to enable further
growth of the community. I already had a working solution to my
problem and was attempting to share it with the world. Not the first
time I've made a fool of myself, LOL.

In the future when I get stuck I will follow Fabio's advice and ask
for guidance from the list. I may also do as Markus suggests and pick
up the Manning book.

I apologize if I've offended anyone as it was not my intention. Is
there a moderator that can lock or remove this topic?

Best Regards,
Sam

Josh Rogers

unread,
Jul 16, 2009, 10:54:55 AM7/16/09
to nhu...@googlegroups.com
On this I guess we'll have to agree to disagree. There are issues
that I have had help from here that definitely was not in the
documentation. Also, the widespread understanding that the learning
curve of NH is extremely steep I believe tends to give credit to my
argument that it is lacking substance, not quality.

I would meet you in the middle somewhere and say that the reference
tells you "most of everything" you would need to know if you already
are quite experienced with NHibernate but for someone new to ORM's or
NH it is not.

Piecing together a bunch of blog posts to get something that should be
in the documentation doesn't strike me as the optimal solution. While
I am grateful that those blogs exist, the argument could be made that
there would not be a need to post solutions to things that were
straight forward in the documentation. Now don't go off on a wild
tangent because of that statement, there are some things that are just
far to complex to represent in documentation thus that is where the
blogs and such would fill in the void (i.e. CpBT, Session Handling).

I see that while I was writing this that Sam posted a response and he
wishes this topic to be locked or closed so then I will respect that
and I will no longer continue to defend my position. I think it is
excellent that Fabio responded and aided him, thank you for that.

Finally, I also thank all of you for both hearing me out and of course
for your contributions and help in the past.

Thanks,
Josh
Reply all
Reply to author
Forward
0 new messages