-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Need to know regarding NHibernate
PostPosted: Wed Jan 09, 2008 9:30 am 
Newbie

Joined: Wed Jan 09, 2008 9:17 am
Posts: 4
Hi,

I am new user of NHibernate. before i use Nhibernate in my application, I want to know below two things.

1) can we use NHiberate with Standalone/Desktop application.
2) I am having N no of Client(NHIbernate implementation is residing in Client Application. if possible to use NHibernate with Desktop App.) with same database. How we will be able to maintain Syncronization with Each user database request from different SessionFactory?

please provide me your guideline so that i will be able to take correct decision before i use NHibernate in my application.

link to above question will be also appreciated.

Regards,
Jigar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 09, 2008 10:42 am 
Regular
Regular

Joined: Wed Jan 25, 2006 1:11 am
Posts: 118
Location: Copenhagen, Denmark
1) Yes, nHibernate can be used in standalone/desktop applications.
2) How do you do this today? The keywords here for me would be Optimistic Concurrency and Database transactions.

For more info regarding your question nr. 2 take a look in the nHibernate Reference manual chapter 10

Feel free to ask again, perhaps a bit more specific :)


Top
 Profile  
 
 Post subject: issue while loading data from database
PostPosted: Thu Jan 10, 2008 2:08 am 
Newbie

Joined: Wed Jan 09, 2008 9:17 am
Posts: 4
Thanks for reply,

i have started to work on NHibernate Quick start. I am able to insert record into database but i am having some issue related to loading data from database on the basis of id . but if i use get() method to get data then it is working.

going through this ==> http://www.hibernate.org/362.html

This is not working

User joeCool = (User)session.Load(typeof(User), "joe_cool1");

getting this exception :


*************
System.TypeLoadException: Access is denied: 'HiberateNetLayer.User'.
at System.Reflection.Emit.TypeBuilder.TermCreateClass(Int32 handle, Module module)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Castle.DynamicProxy.Builder.CodeBuilder.AbstractEasyType.BuildType()
at Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateType()
at Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[] interfaces)
at Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
A first chance exception of type 'NHibernate.HibernateException' occurred in NHibernate.dll


*************

This is working

User joeCool = (User)session.Get(typeof(User), "joe_cool1");

can anyone tell me reason for this as well as solution?

Regards,
Jigar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.