-->
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.  [ 4 posts ] 
Author Message
 Post subject: I want to use just one ConnectionString, but...
PostPosted: Tue May 09, 2006 10:54 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Hi!

Nowadays I'm using two connection strings, because I use the membership/role providers that also need a connection string defined.

I'd like to use the same connectionString above to NHibernate.

Is it possible?

I've tried this, but I got an error:

Code:
<connectionStrings>
    <add name="MySQLConnectionString" connectionString="..."/>
</connectionStrings>

<nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
    <add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect"/>
    <add key="hibernate.connection.driver_class" value="NHibernate.Driver.MySqlDataDriver"/>
    <add key="hibernate.connection.connection_string" value="MySQLConnectionString"/>
</nhibernate>


The error is:

Quote:
{"cannot open connection"}


Wouldn't be interesting to use the same connString defined into the section <connectionString>?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 3:09 pm 
Regular
Regular

Joined: Mon Mar 20, 2006 10:49 pm
Posts: 59
We wrote our own NHibernate-based Membership and Profile providers to achieve that integration. It was more or less simply a matter of taking the MS sample providers and mechanically replacing the persistence logic.

Mike

_________________
Mike Abraham


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 9:47 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
mabraham wrote:
We wrote our own NHibernate-based Membership and Profile providers to achieve that integration. It was more or less simply a matter of taking the MS sample providers and mechanically replacing the persistence logic.

Mike


Hum, Ok.

I've removed the connection string from providers and that's right!

Thanks ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 9:51 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Just another question:

Is it not possible to use the same ConnectionString defined into the <connectionStrings> node to NHibernate?

I'd like to do something like the first post:

Code:
<connectionStrings>
    <add name="MySQLConnectionString" connectionString="..."/>
</connectionStrings>

...
<add key="hibernate.connection.connection_string" value="MySQLConnectionString"/>
...


Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.