Click here to Skip to main content
15,900,973 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to indent SQL statements? Pin
sacoskun20-Feb-06 9:10
sacoskun20-Feb-06 9:10 
Questionmove table record Pin
sebastian yeok18-Feb-06 21:02
sebastian yeok18-Feb-06 21:02 
AnswerRe: move table record Pin
Colin Angus Mackay19-Feb-06 2:47
Colin Angus Mackay19-Feb-06 2:47 
QuestionDifference between two tables Pin
niceguyeddie199917-Feb-06 5:11
niceguyeddie199917-Feb-06 5:11 
AnswerRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 5:35
Colin Angus Mackay17-Feb-06 5:35 
GeneralRe: Difference between two tables Pin
niceguyeddie199917-Feb-06 5:38
niceguyeddie199917-Feb-06 5:38 
GeneralRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 8:46
Colin Angus Mackay17-Feb-06 8:46 
QuestionUrgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy16-Feb-06 17:45
devvvy16-Feb-06 17:45 
I'm having performance issue with this ASP.NET app. From SQL Server log there're MANY MANY log which resembles the following:


SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted.


I'm talking thousands in one morning. And I am suspecting that this is the cause of the performance degradation. I thought when you

<br />
conn.Open();<br />


ADO.NET draws from ADO.NET connection pool using existing connections in the pool and you don't "login" again? Is this assumption right? I ran a very very simple test:

<br />
using System;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
<br />
static void Main(string[] args)<br />
{<br />
	String s_conn = "Data Source=127.0.0.1;Initial Catalog=pubs;User Id=sa;Password=secret;Max Pool Size=80;Min Pool Size=30;";<br />
	IDbConnection oconn;<br />
	Int32 i;<br />
<br />
	oconn = new SqlConnection (s_conn);<br />
	for(i=0; i<100; i++) <br />
	{<br />
		oconn.Open();<br />
<br />
		oconn.Close();<br />
	}<br />
<br />
	return;<br />
}<br />


This did NOT generate a bunch of "Login succeeded" in my SQL Server's Server Log. But then, the surprise was, there was NOT even ONE "Login succeeded" registered.

Btw, I'm using NHibernate... And the way NHibernate open an ISession (corresponds to a IDbConnection) is as follows:


<br />
Dim _nhibernate_conn_factory ISessionFactory = BuildFactory() 'This is time consuming so we only create it once...<br />
<br />
Public Function GetWarehouseNHibernateSession() As ISession Implements IWarehouseConnectionManager.GetWarehouseNHibernateSession<br />
	Dim conn As ISession<br />
	Dim maxRetry, retryFreq As Int32<br />
<br />
	Try<br />
		<br />
		conn = nhibernate_conn_factory.OpenSession()<br />
<br />
	Catch ex As System.Data.SqlClient.SqlException<br />
		'handle the exception<br />
	Catch ex As Exception<br />
		'handle the exception<br />
	End Try<br />
<br />
	Return conn<br />
End Function<br />


My finding is, for each "OpenSession" there's a corresponding entry in SQL Server's log:

"SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted."

Is this normal? On one of my page there's 35 OpenSession - seems like this is what's slowing down the application. Advice? Thanks Thanks!

If you want to look deeper into NHibernate's code, look here

ADO.NET connection pooling REF: http://www.15seconds.com/issue/040830.htm

NHibernate REF: http://nhibernate.sourceforge.net/NHibernateEg/NHibernateEg.Tutorial1A.html
AnswerRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 13:16
Edbert P19-Feb-06 13:16 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy19-Feb-06 14:45
devvvy19-Feb-06 14:45 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 17:03
Edbert P19-Feb-06 17:03 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy19-Feb-06 17:10
devvvy19-Feb-06 17:10 
AnswerAn answer... Pin
devvvy19-Feb-06 17:45
devvvy19-Feb-06 17:45 
QuestionPer-user connection string to get good perf, good idea? Pin
Judah Gabriel Himango16-Feb-06 10:04
sponsorJudah Gabriel Himango16-Feb-06 10:04 
AnswerRe: Per-user connection string to get good perf, good idea? Pin
Colin Angus Mackay16-Feb-06 12:52
Colin Angus Mackay16-Feb-06 12:52 
GeneralRe: Per-user connection string to get good perf, good idea? Pin
Judah Gabriel Himango16-Feb-06 15:45
sponsorJudah Gabriel Himango16-Feb-06 15:45 
GeneralPartitioning Pin
Edbert P16-Feb-06 16:20
Edbert P16-Feb-06 16:20 
GeneralRe: Partitioning Pin
Judah Gabriel Himango16-Feb-06 16:44
sponsorJudah Gabriel Himango16-Feb-06 16:44 
QuestionT- SQL Inner Select Pin
Greeky16-Feb-06 1:21
Greeky16-Feb-06 1:21 
AnswerRe: T- SQL Inner Select Pin
Colin Angus Mackay16-Feb-06 2:16
Colin Angus Mackay16-Feb-06 2:16 
QuestionUML modeling Pin
Klempie15-Feb-06 23:57
Klempie15-Feb-06 23:57 
AnswerRe: UML modeling Pin
Juan Pedro Prez16-Feb-06 2:05
Juan Pedro Prez16-Feb-06 2:05 
GeneralRe: UML modeling Pin
Paul Conrad16-Feb-06 17:14
professionalPaul Conrad16-Feb-06 17:14 
AnswerRe: UML modeling Pin
Klempie16-Feb-06 19:25
Klempie16-Feb-06 19:25 
QuestionHelp with ADO.NET, please Pin
Juan Pedro Prez15-Feb-06 23:20
Juan Pedro Prez15-Feb-06 23:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.