-->
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.  [ 2 posts ] 
Author Message
 Post subject: Reporting services
PostPosted: Mon Mar 24, 2008 6:52 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
Hi!

I'm using Nhibernate for Reporting Service datasource, It works fine
when objects are not laizy loaded.

But when objects are laizy loaded (previously not prefetched), NHibernate tries to open another connection for prefetching the data.
This should be ok, if Nhibernate want's the new connection then fine, but
it produces an security exeption:

Code:
NHibernate.Util.ADOExceptionReporter [(null)] (null) - Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


NHibernate.Util.ADOExceptionReporter [(null)] (null) - NHibernate.ADOException: cannot open connection ---> System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.PermissionSet.Demand()
   at System.Data.Common.DbConnectionOptions.DemandPermission()
   at System.Data.SqlClient.SqlConnection.PermissionDemand()
   at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at NHibernate.Connection.DriverConnectionProvider.GetConnection()
   at NHibernate.Impl.SessionFactoryImpl.OpenConnection()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:
MyComputer
   --- End of inner exception stack trace ---



So it raises a question, why Nhibernate tries to open a new connection. And how could I resolve this issue?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 25, 2008 8:36 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
Since I did'nt hear any sugestions on this part, I just foreach the result and pre initializing the requested laizy properties, at least now it works


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