C# - How To Configure Fluent NHibernate To Output Queries To Trace Or Debug Instead Of Console

Jan 25, 2010

How to configure Fluent NHibernate to output queries to Trace or Debug instead of Console?

I'm using MsSqlConfiguration.MsSql2008.ShowSql() but it has no parameters and I can't find anything on Google.

View 3 Replies


Similar Messages:

ManyToManyMapping With Fluent Nhibernate?

Feb 16, 2011

I have a table USERS and GROUPS table.

I want to add another table UserGroups.

How can I map these tables.

View 1 Replies

ADO.NET :: How To Use Fluent Nhibernate - Finding Tutorials

Nov 9, 2010

, I want to use fluent hibernate with asp.net but couldn't find any website or tutorial for that , they're all to configure it with asp.net mvc , anyone knows any?

View 3 Replies

C# - Fluent NHibernate - Collections Not Filtering?

Aug 27, 2010

I have a session criteria statement (Fluent NHibernate) that does not seem to filter the child collection even though I have Expressions/Restrictions defined.

ICriteria criteria = session.CreateCriteria(typeof(MyClass));
criteria.CreateAlias("MyCollection", "MC");
criteria.Add(Restriction.Eq("MC.Property", value));
IList<MyClass> list = criteria.List<MyClass>();

This returns all the objects of type MyClass that have MyCollection.Property = value, however MyCollection is not filtered to MyCollection.Property = value

It seems like only the Root objects get filtered.

View 2 Replies

C# - Fluent Nhibernate No Persistor For Class Name?

Sep 9, 2010

I am getting this error even though all my mappings are pretty simple and correct. I get this error only on select classes.

View 1 Replies

Fluent NHibernate Data Caching From A Table

Feb 16, 2011

We are developing a multi-language web application with ASP.NET MVC 2 and Fluent NHibernate.Our platform will be multi-language. But just static text will be multi-language. Groups pages depends on community content whatever they use. Like Facebook.We decide to keep all language string in database. And load language when application starts.

View 1 Replies

Fluent NHibernate Cascade - Trying To Insert NULL ID?

Mar 8, 2011

I have the following models & mappings (code snippets further below).

One Competition has to have multiple CompetitionAnswers associated with it (multiple choice) from the outset.

At present, using the Fluent NHibernate mappings shown below, when I create a brand new Competition object, populate the properties, then create 3 brand new CompetitionAnswer objects and add them to the CompetitionAnswers property (property on Competition), I would expect to call Save on the session which would INSERT the 1 Competition row and 3 CompetitionAnswer rows to the DB.

However, as soon as I try to call Save on the session, it complains that CompetitionId is null and it can't insert a null into the CompetitionAnswers table for that field - which is right, it shouldn't, however, I assumed that the NHibernate would first create the Competition, then use the newly generated IDENTITY value (CompetitionId) in the CompetitionAnswers table?

[code]....

View 3 Replies

C# - (Fluent) NHibernate Security Exception - ReflectionPermission

Apr 11, 2010

I've upgraded an ASP.Net Web application to the latest build of Fluent NHibernate (1.0.0.636) and the newest version of NHibernate (v2.1.2.4000). I've checked a couple of times that the application is running in Full trust. But I keep getting the following error:

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +54
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner, StackCrawlMark& stackMark, Boolean skipVisibility) +269
System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility) +81
NHibernate.Bytecode.Lightweight.ReflectionOptimizer.CreateDynamicMethod(Type returnType, Type[] argumentTypes) +165
NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateGetPropertyValuesMethod(IGetter[] getters) +383
NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) +108
NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) +52
NHibernate.Tuple.Component.PocoComponentTuplizer..ctor(Component component) +231
NHibernate.Tuple.Component.ComponentEntityModeToTuplizerMapping..ctor(Component component) +420
NHibernate.Tuple.Component.ComponentMetamodel..ctor(Component component) +402
NHibernate.Mapping.Component.BuildType() +38
NHibernate.Mapping.Component.get_Type() +32
NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping) +39
NHibernate.Mapping.RootClass.Validate(IMapping mapping) +61
NHibernate.Cfg.Configuration.ValidateEntities() +220
NHibernate.Cfg.Configuration.Validate() +16
NHibernate.Cfg.Configuration.BuildSessionFactory() +39
FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:BuildsFluentNHsrcFluentNHibernateCfgFluentConfiguration.cs:93

Anyone had a similar error? I've seach the web / stackoverflow / NHibernate forums but only found people who had a problem when running in medium trust mode, not full trust. I've been developing for several months on this application on this machine with previous versions of Fluent NHibernate and NHibernate.

The machine I'm running this on is 64-bit, you never know that this is relevant.

View 1 Replies

Fluent NHibernate, Dynamically Change Table Of Mapping?

Feb 18, 2010

with fluent nhibernate, is there a way to dynamically switch the table of a mapping at runtime?

public class XYClassMap : ClassMap<XY>
{
public XYClassMap( )
{
Table("XYTable");
Id(d => d.Id).GeneratedBy.Identity();
Map(d => d.Value);
[code]...

View 2 Replies

Using MVC 2, StructureMap, Fluent NHibernate, And PostgreSQL - Finding Tutorials

Aug 8, 2010

I am using the above combo in a new web app Im doing just to try to learn to build new stuff to expand my knowledge. Im hoping to go live if I do a good job.. Im kind of new at MVC and the other products so I was trying to find a link to a good tutorial that set all of these up together.

View 1 Replies

C# - Update Parent Table From Child In Fluent Nhibernate?

Jul 13, 2010

I'm trying to update the data in the parent table that is referenced in the child table from the child's view in Asp.net.

I mapped the tables using Fluent Nhibernate.

In the child table, the mapping looks like this:

[code]....

View 1 Replies

How To Test Generate Tables With Fluent Nhibernate (schemaexport)

Nov 17, 2010

this is my very very first project with fluent hibernate.i've had small experience in hibernate and nhibernate:

This context is completely new to me since this is a web app project.

So i have my webapp project with most of the fluent nhibernate found on the net.

so i have This entities:

[code]....

View 1 Replies

C# - Fluent NHibernate Many-to-many Mapping With Auto-generated Pk Instead Of Composite Key?

Feb 2, 2010

I'm working on a RoleProvider in .NET, using Fluent NHibernate to map tables in an Oracle 9.2 database.

The problem is that the many-to-many table connecting users and roles uses a primary key generated from a sequence, as opposed to a composite key. I can't really change this, because I'm writing it to be implemented in a larger existing system.

Here is my UserMap:

public UserMap()
{
this.Table("USR");[code].....

Yet, this is giving me the error:

Type 'FluentNHibernate.Cfg.FluentConfigurationException' in assembly 'FluentNHibernate, Version=1.0.0.593, Culture=neutral, PublicKeyToken=8aa435e3cb308880' is not marked as serializable.

Is there a simple fix to allow this HasMayToMany to use my PersistentObjectMap extension? I'm thinking I may have to add a convention for this many-to-many relationship, but I don't know where to start with that, since I've just started using NHibernate and Fluent NHibernate only recently.

EDIT: I think I've found a possible solution here: http://marekblotny.blogspot.com/2009/02/fluent-nhbernate-and-collections.html

I'll try the above method of creating an entity and a class map for the linking table and post my findings.

EDIT 2: I created a linking entity as mentioned in the above blog post and downloaded the newest binaries (1.0.0.623).
This helped me discover that the issue was with setting lazy load and trying to add roles to the user object in a completely new session.

I modified the code to move OpenSession to the BeginRequest of an HttpModule as described here. After doing this, I changed my data access code from wrapping the open session in a using statement, which closes the session when it is finished, to getting the current session and wrapping only the transaction in a using statement.

This seems to have resolved the bulk of my issue, but I am now getting an error that says "Could not insert collection" into the USR_ROLE table. And I'm wondering if the above code should work with a UserRoleMap described as:

public UserRoleMap()
{
this.Table("USR_ROLE"); [code]....

Hibernate's documentation for many-to-many relationship suggests creating an object to maintain a one-to-many/many-to-one, as in an ERD. I'm sure this would be much easier with conventional naming standards, but I have to stick with certain abbreviations and odd (and not always properly-implemented) conventions.

View 1 Replies

Fluent Nhibernate Exception Error In System.Xml.Schema.XmlSchemaValidationException / How To Fix It

Jan 29, 2010

am trying to implement fluent nhibernate in MVC project...there were no build errors... but when i run the project i get this exception

System.Xml.Schema.XmlSchemaValidationException: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'meta, subselect, cache, synchronize, comment, tuplizer, id, composite-id' in namespace 'urn:nhibernate-mapping-2.2'.

have no idea what am doing wrong here... the following is the code for opening session factory...

[code]....

View 3 Replies

Can Write A Unit Test For CRUD Using In Memory Database With Fluent Nhibernate

Jul 6, 2010

How can I write a unit test for CRUD using in memory database with fluent nhibernate

View 2 Replies

Nhibernate Configure And Buildsessionfactory Time?

Mar 30, 2010

I'm using Nhibernate as the OR/M tool for an asp.net application and the startup performance is really frustrating. Part of the problem is definitely me in my lack of understanding but I've tried a fair bit (understanding is definitely improving) and am still getting nowhere.

Currently ANTS profiler has that the Configure() takes 13-18 seconds and the BuildSessionFActory() as taking about 5 seconds. From what i've read, these times might actually be pretty good, but they were generally talking about hundreds upon hundreds of mapped entities...this project only has 10.

I've combined all the mapping files into a single hbm mapping file and this did improve things but only down to the times mentioned above...

I guess, are there any "Traps for young players" that are regularly missed...obvious "I did this/have you enabled that/exclude file x/mark file y as z" etc...

I'll try the serialize the configuration thing to avoid the Configure() stage, but I feel that part shouldn't be that long for that amount of entities and so would essentially be hiding a current problem...

configuration code- hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"

[code]...

View 2 Replies

Configure NHibernate Profiler So Can Enable/disable It Without Changing Code?

Mar 2, 2010

I've been trying to follow the directions on the NHProf site but can't seem to make it work. What am I missing?I put a log4net configuration section in my web.config:

<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net/>

[code]...

View 2 Replies

SQL Server :: How To Debug Queries And Stored Procedures

Mar 24, 2011

How to debug queries and stored procedures in sql server 2008 like we doing in vs

View 1 Replies

Web Forms :: How To Capture Url And Show The Hyperlink Button Data Output In Console Application

Oct 6, 2010

i have an assignment , i have to capture a url which contain some hyperlink btn, i have to show the hyperlink btn text and their description

View 5 Replies

MVC :: How To Configure/see Debug Information For The Layer

May 24, 2010

How can I see debug/trace type info for the MVC layer. This would be things like see the incoming HTTP requests, which routes they are mapped again, the incoming parameters etc.

(i.e. same kind of info I see when I am working on a Ruby on Rails app for it's MVC infrastructure)

View 2 Replies

Fluent Nhibernate System.ApplicationException : For Property 'Id' Expected '1' Of Type 'System.Int32' But Got '2' Of Type 'System.Int32'

Jul 6, 2010

I am writing unit tests for fluent Nhibernate, when I run the test in isloation it passes, but when I run multiple tests. or run the test more than once it starts failing with the message below System.ApplicationException : For property 'Id' expected '1' of type 'System.Int32' but got '2' of type 'System.Int32'

[TextFixture]
public void Can_Correctly_Map_Entity()
{
new PersistenceSpecification<UserProfile>(Session)
.CheckProperty(c => c.Id, 1)
.CheckProperty(c => c.UserName, "user")
.CheckProperty(c => c.Address1, "Address1")
.CheckProperty(c => c.Address2, "Address2")
}

View 2 Replies

Configuration :: Cannot Add Trace Trace.Listeners.Add

Feb 2, 2011

I am trying to redirect my trace output to a text file.

For this I tried to add a textwritertracelistener object to Trace.Listeners.Add but I can't see Listeners Class in Trace.ie When I put Trace. the Listeners class is not popup. Also I am unable to add System.Diagnostics.TraceListener namespace to the page.

My code is as given below ..

[Code]....

View 1 Replies

AJAX :: Unable To Debug / Debug EditPanel.debug.js File Of HTML Editor?

Apr 13, 2010

I want to debug EditPanel.debug.js file of HTML Editor, but it never shows in VS 08 and Im sure it executes to that line.What I did to enable debuggingUnchecked both 2 checkboxes for disabling the debugging

Set ScriptMode="Debug"

Change following line

[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.js")]
to
[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.debug.js")]

View 3 Replies

Forms Data Controls :: Nested RadioButtonList, And Inconsistency Between Debug And Run Without Debug

Feb 23, 2010

On my web form, I have a RadioButtonList nested within a ListView as follows:

Nested RadioButtonList, and Inconsistency between Debug and Run without Debug

View 2 Replies

Visual Studio :: Debug-Start Debugging/Debug-StartWithoutDebugging OR Project Configuration Launches Dream?

Jan 3, 2010

Debug-Start Debugging/Debug-StartWithoutDebugging OR Project ASP.Net Configuration launches Dreamweaver. It started lastnight, I had both Deamweaver and VWD 2008 express open at the same time - (I was looking at JQuery in the Microsoft and Dreamweaver enviroments simultaniously). After the first tie this happened, I closed down Dreamweaver (CS3) and it opened when I tried to run my VWD project. I reinstalled VWD 2008 express, IIS and disabled Dreamweaver (renamed the exe). Dreamweaver still came up.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved