-->
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.  [ 1 post ] 
Author Message
 Post subject: How to use nhibernate in web service (architecture)
PostPosted: Tue Dec 23, 2008 6:11 pm 
Newbie

Joined: Tue Dec 23, 2008 5:30 pm
Posts: 1
Does sombody knows a detailed example, that describes how nhibernate could be used in web services?

I have a silverlight application that must communicate with a web service (not WCF). The web service is using nHibernate to connect to the database. When calling the web method in the web service, a database name, loginID and pasword is passed.

[webmethod]
List<...> getCustomers(string dbname, string loginID, string password)
{ ...
}

I could set the connection string onto the configuration
Configuration cfg = new Configuration();
cfg.properties[...ConnectionString] = ....
but it seems I can add the assemblies only once. When I call the following example code twice, I recieve an error concerning the compilation of mapping files.
Configuration cfg = new Configuration();
cfg.AddAssembly("NHibernate.Examples");

It's also not very clear to me how i have to keep track of the different connectionstrings into the web service. (I'am new to both web services, silverlight and nhibernate)


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

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.