inconsistent profiler reporting

2 views
Skip to first unread message

John Smith

unread,
Oct 22, 2010, 1:09:19 PM10/22/10
to LLBLGenProf
I am a new LLBLGen Pro user (less than one week) and this is my 2nd
day using LLBLGenProf so I'm sure my problem is a result of something
I'm doing wrong, so any comments would be very welcome!

Yesterday everything seemed to be working great, however I was just
retrieving data using the first code sample below. The SELECT
statement displayed in the tool perfectly each time.

Today if the record I'm looking for isn't found I am inserting it via
the second sample code sample below. I am looking for 3 specific
records in a table, and if any one of them is missing I insert it.

To test my code I delete all 3 records, so I would think the profiler
would display 3 SELECT statements and then 3 INSERT statements. The
problem is, the profiler displays sporadic information such as 1 or 2
of the SELECT statements, but never any of the INSERT statements.

At one point when I was building up my routines I was able to see an
INSERT statement in the profiler, but that was when I was only
building a single record, not checking and then building.

I know this isn't what's happening, but it seems like the profiler
isn't "catching" all the LLBLGen Pro events since my code runs fine.
If I delete 3 records, LLBLGen (and my program) understands they are
missing and builds them with no problems.

Any ideas as to what I'm doing wrong? I'm running LLBL Gen Pro Final
3.0, October 8th, 2010, and LLBLGenProfiler build 742.

Many thanks!

---

// retrieve the data
LinqMetaData metaData = new LinqMetaData(adapter);
var q = from d in metaData.TblDocFolder
where d.Uuid == uuid
select d;

// load the collection
EntityCollection<TblDocFolderEntity> documents =
((ILLBLGenProQuery)q).Execute<EntityCollection<TblDocFolderEntity>


---

// build the missing record
tblDocFolderRecord = new TblDocFolderEntity();
tblDocFolderRecord.Uuid =
fsc.DocFolderAomStatements.Uuid;
tblDocFolderRecord.Name =
fsc.DocFolderAomStatements.Name;
tblDocFolderRecord.Types =
fsc.DocFolderAomStatements.Types;

// setup the database connection
adapter = new
DataAccessAdapter(AomUtility.FileStorDataRepositoryProfile.DatabaseConnectionString,

AomUtility.FileStorDataRepositoryProfile.KeepConnectionOpen,

AomUtility.FileStorDataRepositoryProfile.CatalogNameOverwrites,

AomUtility.FileStorDataRepositoryProfile.SchemaNameOverwrites);

// save the record
adapter.SaveEntity(tblDocFolderRecord);

Ayende Rahien

unread,
Oct 26, 2010, 1:30:57 AM10/26/10
to llblg...@googlegroups.com
Hi,
The problem is likely that your process is shutting down too quickly.
The profiler reports all the data on the background, so as not to take too much of your time.
You need to wait until the profiler has finished processing, you can do that using:

ProfilerIntegration.FlushAllMessages();

Put this at the end of your application (or the Unit Test TearDown method.

John Smith

unread,
Oct 26, 2010, 9:37:56 AM10/26/10
to LLBLGenProf
That worked perfect. Thanks!

And just to help the next guy the namespace is actually
ProfilerInfrastructure.

John
Reply all
Reply to author
Forward
0 new messages