ranzlee / nhibernate.extensions Goto Github PK
View Code? Open in Web Editor NEWHelper libs for NHibernate
Helper libs for NHibernate
I am using a DB2 database. Some of my fields are of type xml. When I issue insert or update commands referring to those xml fields, the generated SQL only shows the type and size of xml parameters, but I want to see what is the content of the xml paramter.
Look at p5 and p6 in the follwoing SQL (generated by Glimpse):
UPDATE Standard.DataTuples SET VersionNo = ?, Extra = ?, OrderNo = ?, TupleAction = ?, Timestamp = ?, XmlVariableValues = ?, XmlAmendments = ?, DatasetVersionRef = ? WHERE Id = ? AND VersionNo = ?; p0 = 3 [Type: Int32 (4)], p1 = NULL [Type: Xml (0)], p2 = 0 [Type: Int32 (4)], p3 = 0 [Type: Int32 (4)], p4 = 23-Oct-13 9:26:57 AM [Type: DateTime (16)], p5 = [Type: Xml (5374)], p6 = [Type: Xml (374)], p7 = 465 [Type: Int64 (8)], p8 = 638 [Type: Int64 (8)], p9 = 2 [Type: Int32 (4)]
When using NHibernate.Glimpse, none of the log4net appenders work anymore for the NHibernate loggers.
Any way to configure it to be able to use both NHibernate.Glimpse and log4net at the same time?
Thanks!
Hi,
is there a a version of this extension compatible with NHibernate 4.0.x ?
This one doesn't work. It throws this expcetion:
Method 'EmitMethodBody' in type 'NHibernate.DependencyInjection.Core.DefaultMethodEmitter' from assembly 'NHibernate.DependencyInjection, Version=3.3.3.4001, Culture=neutral, PublicKeyToken=null' does not have an implementation.
It would be very useful to be able to see line number and source file in stack trace for each level of the call stack.
I'm willing to help with the implementation if you want, just need to be told where in the code that can be added. :)
I have an MVC4 application storing documents in a database, and I have a very simple action for retrieving them in the form of ~/documents/view/{documentId}, and it works perfectly.
I have also made the action in my app utilize async in case of large documents
public async Task<ActionResult> View(Guid id)
{
var getDocumentAsync = Task.Factory.StartNew(() => documentService.GetDocument(id));
var document = await getDocumentAsync;
if (document == null)
return HttpNotFound();
/* .... other logic ... */
return File(document.Data, document.ContentType); //document.Data uses lazy loading, not sure if that's relevant yet...
}
This works great. But with the Glimpse.NHibernate pluin installed I get an error at the return File(...)
line. If I remove Glimpse.NHibernate it goes away, if I convert my action to be a normal action, it goes away but with it, I get the following error with stacktrace. I'm assuming this is an issue with the Glimpse.NHibernate code not handling the way async
works?
[ArgumentNullException: Value cannot be null.
Parameter name: httpContext]
System.Web.HttpContextWrapper..ctor(HttpContext httpContext) +9658614
Glimpse.AspNet.AspNetFrameworkProvider.get_Context() +89
Glimpse.AspNet.AspNetFrameworkProvider.get_HttpRequestStore() +41
Glimpse.Core.Framework.<>c__DisplayClass5.<InstantiateRuntimePolicyStrategy>b__4() +39
NHibernate.Glimpse.InternalLoggers.SqlInternalLogger.Debug(Object message) +155
HibernatingRhinos.Profiler.Appender.NHibernate3Logger.ProfilerLogger.Debug(Object message) +40
NHibernate.AdoNet.Util.SqlStatementLogger.LogCommand(String message, IDbCommand command, FormatStyle style) +262
NHibernate.AdoNet.Util.SqlStatementLogger.LogCommand(IDbCommand command, FormatStyle style) +44
NHibernate.AdoNet.AbstractBatcher.LogCommand(IDbCommand command) +96
NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +90
NHibernate.Persister.Entity.AbstractEntityPersister.InitializeLazyPropertiesFromDatastore(String fieldName, Object entity, ISessionImplementor session, Object id, EntityEntry entry) +519
NHibernate.Persister.Entity.AbstractEntityPersister.InitializeLazyProperty(String fieldName, Object entity, ISessionImplementor session) +702
NHibernate.Intercept.AbstractFieldInterceptor.InitializeField(String fieldName, Object target) +130
NHibernate.Intercept.AbstractFieldInterceptor.Intercept(Object target, String fieldName, Object value) +395
NHibernate.Intercept.DefaultDynamicLazyFieldInterceptor.Intercept(InvocationInfo info) +391
DocumentProxy.get_Data() +283
MyAppNamespace.Web.Controllers.<View>d__12.MoveNext() in c:\Development\MyAppNamespace\Controllers\DocumentsController.cs:144
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter.GetResult() +21
lambda_method(Closure , Task ) +64
System.Threading.Tasks.TaskHelpersExtensions.ThrowIfFaulted(Task task) +31
System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +67
System.Web.Mvc.Async.<>c__DisplayClass3f.<BeginInvokeAsynchronousActionMethod>b__3e(IAsyncResult asyncResult) +16
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48
Castle.Proxies.AsyncControllerActionInvokerProxy.EndInvokeActionMethod_callback(IAsyncResult asyncResult) +41
Castle.Proxies.Invocations.AsyncControllerActionInvoker_EndInvokeActionMethod.InvokeMethodOnTarget() +103
Castle.DynamicProxy.AbstractInvocation.Proceed() +117
Glimpse.Core.Extensibility.CastleInvocationToAlternateMethodContextAdapter.Proceed() +48
Glimpse.Mvc.AlternateType.EndInvokeActionMethod.NewImplementation(IAlternateMethodContext context) +152
Glimpse.Core.Extensibility.AlternateTypeToCastleInterceptorAdapter.Intercept(IInvocation invocation) +183
Castle.DynamicProxy.AbstractInvocation.Proceed() +483
Castle.Proxies.AsyncControllerActionInvokerProxy.EndInvokeActionMethod(IAsyncResult asyncResult) +203
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +57
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +223
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129
Hi,
I have just forked out this repository, and I am getting an error that Database.sdf files are missing.
May be I am missing some very trivial. What is it?
Hi,
is it currently possible (or could be easily made) to put a sql counter directly on the default History and Ajax Glimpse tabs.
I'm asking because I have a lot of ajax requests. And to see if my queries are efficient I have to "Inspect" requests one by one, change to NHibernate tab, and see how many queries are being fired.
It would be a huuuuge time saver if I could see all counts on one screen so I can just inspect the ones that seem suspicious.
I must upgrade to NHibernate version 3.3.3.4001 released on 8/8/2013 to get a bug fix I've been waiting forever on. (http://sourceforge.net/projects/nhibernate/files/NHibernate/3.3.3SP1/)
But I cannot upgrade one of my projects because NHibernate.Glimpse doesn't support that NHibernate Dependency version.
Can you update the required NHibernate Dependency to allow 3.3.3.4001 ?
It seems that point.Duration will always be zero and the StartTime will always be the end time of the sql statement that was run.
When I run pages with long queries, Glimpse always shows the queries as taking 0ms.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.