Use a [TestFixtureSetUp] method on your test where you init the sqlMap and a [SetUp] method where you re-init your database, see the current BaseTest.cs unit file in SVN.
You could also use the version in SVN, which remove the usage of XmlSerialization for init ans speed up the loading of config file.
On 8/16/05, Shawn Smiley <[EMAIL PROTECTED]> wrote:
Slight clarification on my previous message.
I see the 8-10 second wait each time the NUnit test is
run. However if I create another test with a loop in
it, the loop executes 10 times in about 9 seconds on
average.
So I guess a better question would be how to reduce
the initial time that it takes to get back a result
set?
Thanks.
--- Shawn Smiley <[EMAIL PROTECTED]> wrote:
> This happens consistently. I've run the test 15
> times
> in a row with the response time varying between 8
> and
> 10 seconds each time.
>
> My call into iBatis is from a static method that has
> only the following two lines it it:
> IList Results =
> _Mapper.QueryForList("SelectVisitTeamsByVisit_New",
> visitId);
> return Results;
>
>
> Here are the entries in my xml files.
>
> <resultMap id="VisitTeamUserMap"
> class="VisitTeamUser">
> <result property="ArtifactDirectory"
> column="ArtifactDirectory" />
> <result property="TeamIconCollectionName"
> column="IconCollectionName" />
> <result property="TeamId" column="TeamID" />
> <result property="TeamName" column="TeamName" />
> <result property="Version" column="Version" />
> <result property="VisitId" column="VisitID" />
> <result property="Active" column="UserActive" />
> <result property="Deleted" column="Deleted" />
> <result property="Email" column="Email" />
> <result property="EncryptedPassword"
> column="Password"
> />
> <result property="FirstName" column="FirstName" />
> <result property="Grade" column="Grade" />
> <result property="LastName" column="LastName" />
> <result property="MustChangePassword"
> column="MustChangePassword" />
> <result property="PhoneNumber" column="PhoneNumber"
> />
>
> <result property="Title" column="Title" />
> <result property="UserId" column="UserID" />
> <result property="Username" column="Username" />
> <result property="DefaultPassword"
> column="DefaultPassword" />
> <result property="UserTeamId" column="TeamID" />
> <result property="UsernameNumber"
> column="UsernameNumber" />
> <result property="UserVersion" column="UserVersion"
> />
> </resultMap>
>
> <select id="SelectVisitTeamsByVisit_New"
> parameterClass="int" resultMap="VisitTeamUserMap">
> SELECT T.TeamName, T.IconCollectionName, T.Active,
> VT.TeamID, VT.VisitID,
> VT.ArtifactDirectory, VT.Version, UA.UserID ,
> UA.OrganizationID, UA.SupervisorUserID,
> UA.PrivacyLevel, UA.Gender, UA.UserType,
> UA.WorkspaceStatus, UA.Username,
> UA.Password, UA.FirstName, UA.LastName, UA.Email,
> UA.PhoneNumber, UA.Active AS UserActive,
> UA.MustChangePassword, UA.Title, UA.Deleted,
> UA.Grade,
> UA.DefaultPassword,
> UA.UsernameNumber, UA.Version AS UserVersion
> FROM Teams T
> LEFT OUTER JOIN VisitTeams VT ON
> T.TeamName=VT.TeamName AND VisitID=#value#
> INNER JOIN UserAccounts UA ON VT.TeamID=UA.TeamID
> ORDER BY T.TeamName
> </select>
>
>
>
> Thanks again.
>
>
>
> --- Larry Meadors <[EMAIL PROTECTED]> wrote:
>
> > No, that is not at all normal.
> >
> > Are you seeing that consistently, or only on the
> > first load?
> >
> > Larry
> >
> >
> > On 8/16/05, Shawn Smiley <[EMAIL PROTECTED]>
> > wrote:
> > > I'm using iBatis on my first project and love
> the
> > > separation of the data access from my code.
> > >
> > > However after implementing a few pages of my
> > > application using it, I'm noticing a significant
> > > performance cost to using iBatis.
> > >
> > > For example, I have a simple query that returns
> 48
> > > rows of 40 fields each. The query itself
> returns
> > in a
> > > fraction of a second in the SQL Query Analyzer,
> > > however the unit test calling through iBatis
> takes
> > > 8-10 seconds to return the 48 objects.
> > >
> > > My result map does not do any selects or fancy
> > data
> > > conversions. The query results map directly to
> > > properties in the data class using all primative
> > data
> > > types (strings, ints, bools).
> > >
> > > Is this performance hit normal and is there
> > anything I
> > > can do to improve it?
> > >
> > >
> > > Thanks,
> > > Shawn.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> ____________________________________________________
> > > Start your day with Yahoo! - make it your home
> > page
> > > http://www.yahoo.com/r/hs
> > >
> > >
> >
>
>
>
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

