We have a custom adapter written for BizTalk. The adapter accepts
incoming messages, and uses our framework to write data out to the
oracle database using NHibernate. We are actually using Spring.Net
1.2 with NHibernate 2.0.1. As part of writing data to the database,
we check to see if it already exists. The following code is executed
to check for existing data.
/////////////// Code snippet ///////////////////////////
public IMember RetrieveByLoyaltyIDNumber(string loyaltyIDNumber)
{
IMember member = null;
string queryStr = string.Format("from Member m,
VirtualCard v where v.IpCode = m.IpCode and v.LoyaltyIdNumber =
'{0}'", loyaltyIDNumber);
ISession session = CurrentSession;
IQuery query = session.CreateQuery(queryStr);
System.Collections.IList result = query.List();
foreach (Object[] pair in result)
{
IMember temp = (IMember)pair[0];
if (member == null)
{
member = temp;
}
if (member.IpCode == temp.IpCode)
{
IVirtualCard card = (IVirtualCard)pair[1];
card.Member = member;
member.LoyaltyCards.Add(card);
}
}
return member;
}
//////////////////////////////////////////////////////////////////
When running a file of about a 30,000 records, we noticed that the
size of the process keeps growing. If this method is not executed, it
stays steady. In short, when the BizTalk process size exceeds certain
thresholds, BizTalk runtime starts throttling delivery of messages and
everything slows down to a crawl.
Running JetBrain's dotTrace memory profiler revealed that 60% of held
memory was allocated in the "CreateQuery" method of the session. As
this method is repeatedly called, once for every record that needs to
be inserted, any leaked memory becomes significant.
Can anyone shed some light and tell me why that is so and what could I
do differently to avoid that.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---