<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Wilson ORMapper Forums : Advanced Topics</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=rss&amp;id=7&amp;key=uM8oo3PEIrYKSIJoqq%2f7wg%3d%3d</link><description>Wilson ORMapper Forums : Advanced Topics</description><item><title>Parent child relationship</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2593&amp;key=Pb1fDWdtJJEt1YfJ34jmvQ%3d%3d&amp;post=7749</link><pubDate>Thu, 18 Oct 2007 13:40:21 GMT</pubDate><description>&lt;P&gt;My app has categories with subcategories.&amp;nbsp; So from any category I want to be able to traverse its parent category, and its parent category, all the way back up to the master category.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The category database table is setup as Id, Name, ParentId.&amp;nbsp; The related Category class has a Parent class of the same type.&amp;nbsp; In the mapping file, Parent is setup as a ManyToOne relationship with lazyLoad set to false.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This works, but only up to three levels deep.&amp;nbsp; After three levels the Parent field is no longer loaded, even though the master category has not been loaded.&amp;nbsp; I imagine this is a designed feature to prevent the object graph from becoming too big.&amp;nbsp; Is there a way I can tell the mapper that I want it to load &lt;EM&gt;all&lt;/EM&gt; levels, or at least specify the maximum?&lt;/P&gt;
&lt;P&gt;Jordan&lt;/P&gt;</description></item><item><title>Inserting in joined table</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2579&amp;key=F%2bz5YZ95uUcjaQctyA%2fw4Q%3d%3d&amp;post=7726</link><pubDate>Thu, 06 Sep 2007 13:30:50 GMT</pubDate><description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;how can I manage the insering in a class mapped to a table joined with another one?&lt;/P&gt;
&lt;P&gt;Let me say this is the part of the FileMap that defines the mapping of the entity Customer.&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;FONT color=#a31515 size=2&gt;entity&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;type&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Keypass.KeyVOIP.Customer&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;table&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;tacnAnagraficaContatti&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;keyMember&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;id&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;keyType&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Auto&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;attribute&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;member&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;id&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;field&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;acnId&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;alias&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Id&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;attribute&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;member&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;telephoneNumber&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;field&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;acnDescrizione&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;alias&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TelephoneNumber&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;lookup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;member&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;description&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;field&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;angDescrizione&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;table&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;tangAnagrafica&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;foreignKey&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;acnangId&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;lookupKey&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;angId&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;alias&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Description&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;entity&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The problem is:&amp;nbsp; acnanfId is the foreign key of the table tacnAnagraficaContatti with respect of the table tangAnagrafica and it's not well valued when I try to execute an Inserting.&lt;/P&gt;
&lt;P&gt;How can I achieve this inserting by not using relations?&lt;/P&gt;
&lt;P&gt;Thank you so much and sorry for my bad English.&lt;/P&gt;
&lt;P&gt;Andrea.&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>LINQ support???</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2543&amp;key=yUHpAEz0%2f8hfz1bBHNPp%2bw%3d%3d&amp;post=7643</link><pubDate>Mon, 04 Jun 2007 18:17:47 GMT</pubDate><description>&lt;P&gt;I've noticed on the MSDN C# home page several LINQ provider links (even one to NHibernate) ... so I was wondering, is there one already in the works for WORM???&lt;/P&gt;
&lt;P&gt;Also, Paul ... just out of curiousity, do you see C# 3.x driving any major changes to the ORM?&amp;nbsp; And if so, what and when we will see them?&lt;/P&gt;
&lt;P&gt;thanks - wayde&lt;/P&gt;</description></item><item><title>Reading xml output</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2539&amp;key=ozGRoNh0gocdaKTUcI8AIg%3d%3d&amp;post=7639</link><pubDate>Wed, 30 May 2007 19:11:40 GMT</pubDate><description>&lt;P&gt;Hi Andrea:&lt;/P&gt;
&lt;P&gt;I think the correct answer is the same for most (if not all) O/R Mappers.&amp;nbsp; That answer is that you simply step outside of the O/RM and use ADO.NET instead.&amp;nbsp; My O/RM tries to put the most common features into the O/RM API so that you can use it as a general purpose DAL as well as an O/RM in most cases.&amp;nbsp; But there are certainly going to be cases where you have to resort to ADO.NET -- and there's nothing wrong with that when it makes sense.&lt;/P&gt;
&lt;P&gt;Thanks, Paul Wilson&lt;/P&gt;</description></item><item><title>Reading xml output</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2539&amp;key=ozGRoNh0gocdaKTUcI8AIg%3d%3d&amp;post=7638</link><pubDate>Wed, 30 May 2007 08:42:42 GMT</pubDate><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would need to read an xml output generated by a select statement with the option 'for xml explicit'&lt;/P&gt;
&lt;P&gt;I heard about the truncation to 2034 characters problem using executescalar: &lt;/P&gt;
&lt;P&gt;more info&amp;nbsp;about the issue can be found at:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://aspnetresources.com/blog/executescalar_truncates_xml.aspx"&gt;http://aspnetresources.com/blog/executescalar_truncates_xml.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;How can I achieve thais reading&amp;nbsp;with Wilson OR mapper?&lt;/P&gt;
&lt;P&gt;Thanks to you and best regards.&lt;/P&gt;
&lt;P&gt;Andrea Pierini.&lt;/P&gt;</description></item><item><title>Logical delete support</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2528&amp;key=YiFzs%2fWxiePckxaKOOjcoA%3d%3d&amp;post=7618</link><pubDate>Fri, 11 May 2007 16:08:10 GMT</pubDate><description>&lt;P&gt;Hi Matt:&lt;/P&gt;
&lt;P&gt;You can create a view that returns only "non-deleted" records and map to it instead of the underlying table.&amp;nbsp; Then there are two ways to handle your logical "deletes":&amp;nbsp; (1) always call a "delete" method on your object that hides the reality that its a logical delete, or (2) make a trigger that intercepts deletes and turns them into logical deletes.&amp;nbsp; Which is "better"?&amp;nbsp; I don't think there is a single right answer to that.&amp;nbsp; In some cases it may be better to make the app responsible, while in other cases you must guarantee what happens no matter what in which case the database is the only place to do that.&lt;/P&gt;
&lt;P&gt;Thanks, Paul Wilson&lt;/P&gt;</description></item><item><title>Logical delete support</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2528&amp;key=YiFzs%2fWxiePckxaKOOjcoA%3d%3d&amp;post=7615</link><pubDate>Fri, 11 May 2007 09:14:58 GMT</pubDate><description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm looking for feedback, and some guidance from those more familiar with WORM then myself, on the best way to do logical deletes with WORM.&lt;/P&gt;
&lt;P&gt;For example, I want to set an IsDeleted field to true instead of calling DELETE FROM on the record. Obviously all the SELECT queries on that table need to be modified to include a IsDeleted = 0 where clause.&lt;/P&gt;
&lt;P&gt;I asked this question a couple of months ago, but didn't get much of a reply. I've had more of a chance to look through the source code of WORM, and I've had some ideas.&lt;/P&gt;
&lt;P&gt;I could write my own adapter, but that looks (a) not re-usable, (b) the wrong place to do it, and (c) prone to mistakes.&lt;/P&gt;
&lt;P&gt;I can just intercept the SQL on the way to the DB, and modifiy it as required, but that's a bit nasty, too.&lt;/P&gt;
&lt;P&gt;Paul, do you have any suggestions as to how you would approach this? This is a feature I'd be happy to work on, and contribute patches for, so I'd like to fit in with your overall plans for the direction of WORM if possible.&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR&gt;Matt&lt;/P&gt;</description></item><item><title>returning List&lt;T&gt; instead of IList&lt;T&gt; from GetCollection</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2511&amp;key=H8yjdp%2bx7Rl1N12OR7wQDw%3d%3d&amp;post=7598</link><pubDate>Tue, 01 May 2007 23:24:04 GMT</pubDate><description>&lt;P&gt;The GetCollection&amp;lt;T&amp;gt;() methods return a Collection&amp;lt;T&amp;gt;, which can be cast to IList&amp;lt;T&amp;gt; but not List&amp;lt;T&amp;gt;.&amp;nbsp; On the other hand, GetCollection() methods are declared as IList, but they actually return the collection type you specify, so you can cast them to whatever that may be.&lt;/P&gt;
&lt;P&gt;Thanks, Paul Wilson&lt;/P&gt;</description></item><item><title>returning List&lt;T&gt; instead of IList&lt;T&gt; from GetCollection</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2511&amp;key=H8yjdp%2bx7Rl1N12OR7wQDw%3d%3d&amp;post=7572</link><pubDate>Tue, 01 May 2007 23:21:08 GMT</pubDate><description>Hi Paul,&lt;br&gt;&lt;br&gt;I guess it's newbie question but will it be possible to have List&amp;lt;T&amp;gt; returned from GetCollection instead of IList&amp;lt;T&amp;gt;? because it is much easier to work with List&amp;lt;T&amp;gt; because of anonymous methods. If not, can't we cast from IList&amp;lt;T&amp;gt; to List&amp;lt;T&amp;gt;? i may sound foolish but i am so confused.... &lt;br&gt;&lt;br&gt;any help appreciated.&lt;br&gt;&lt;br&gt;</description></item><item><title>system.transaction.transactionscope, webservice, connection pooling on</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2495&amp;key=iLmQj38CQE8xKKdlaS6AFg%3d%3d&amp;post=7530</link><pubDate>Mon, 26 Mar 2007 18:57:11 GMT</pubDate><description>&lt;P&gt;Hi Fedor:&lt;/P&gt;
&lt;P&gt;Its because using the System.Transaction.TransactionScope is being a little too intrusive here.&amp;nbsp; Why?&amp;nbsp; Because I've wrapped the System.Data.IDbTransaction in my own Transaction class to guarantee transactions are left pending, along with their open connections.&amp;nbsp; In the perfect world that shouldn't happen, but unfortunately I've seen it happen all too often, especially when people don't use try/catch/finally (or using).&amp;nbsp; But my special handling and the new TransactionScope are probably getting in each other's way here, so you'll mostly likely need to use my Transaction class exclusively.&lt;/P&gt;
&lt;P&gt;Thanks, Paul Wilson&lt;/P&gt;</description></item><item><title>system.transaction.transactionscope, webservice, connection pooling on</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2495&amp;key=iLmQj38CQE8xKKdlaS6AFg%3d%3d&amp;post=7519</link><pubDate>Mon, 26 Mar 2007 18:39:47 GMT</pubDate><description>&lt;FONT size=4&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;FONT size=3&gt;Testresults show that without connection pooling, the error doesn't appear, all works well.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;FONT size=3&gt;Are there know issues with connection pooling and the ORMapper?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=3&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;FONT size=3&gt;Fedor&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;-----------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;Hi Paul,&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;We have used your ORMapper with transactions in a application. It works perfectly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;At this moment we use your ORMapper with system.transaction.transactionscope, via a webservice, using connection pooling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;To use it with a webservice, we stored the object space in the http context current items collection, like your example.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;We have problems with the transactions. Two errors occur:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;"The commit transaction request has no corresponding begin transaction. (Microsoft OLE DB Provider for SQL server)"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;"The transaction has aborted"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;After an error the webservice gives an error for a few minutes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;"New request is not allowed to start because it should come with valid transaction descriptor"&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;--------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;for this last error we have installed hotfix KB916002. This reduced the frequency of the error, but didn't eliminate it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;The kb article says the cause is a finishing transaction on an open connection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;Could there be a connection in the ORMapper that stays open? &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;--------------&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;We get the error on a testing system with limited resources (only 512MB, slow processor).&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;We have also tested without the ORMapper with system.transaction.transactionscope, via a webservice, using connection pooling. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;This way we couldn't reproduce the errors above.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;We want to use the ORMApper, because it works perfectly before.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;Is there something we could check in relation with the ORMapper? Or could there be another thing causing these errors?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;Any help appreciated,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;With regards,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:PersonName w:st="on"&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt;Fedor Kauffman&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/st1:PersonName&gt;&lt;FONT face=Arial size=1&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: Arial"&gt; / Sander Prost&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>Querying fields across many objects</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2463&amp;key=kz%2fDIyBWeFLwE%2fWWGeWIIA%3d%3d&amp;post=7507</link><pubDate>Mon, 26 Mar 2007 18:38:15 GMT</pubDate><description>&lt;P&gt;If you're willing to take the performance hit for a more OO design and you have small objects and a small number of objects being returned, you might be able to create a property on your main object that just passes through to the object which has the property you need. Then you can bind the grid to the object collection.&lt;/P&gt;
&lt;P&gt;For example, suppose you have an Invoice object which a Customer object.&amp;nbsp; You could add a CustomerName property to Invoice like so:&lt;/P&gt;
&lt;P&gt;Public ReadOnly Property CustomerName() As String&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Return Me.Customer.Name&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;End Get&lt;BR&gt;End Property&lt;/P&gt;
&lt;P&gt;--Bill Daly&lt;/P&gt;</description></item><item><title>Querying fields across many objects</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2463&amp;key=kz%2fDIyBWeFLwE%2fWWGeWIIA%3d%3d&amp;post=7442</link><pubDate>Sat, 03 Feb 2007 00:15:29 GMT</pubDate><description>There is a GetDataSet method which you can use to simply return a DataSet.</description></item><item><title>Querying fields across many objects</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2463&amp;key=kz%2fDIyBWeFLwE%2fWWGeWIIA%3d%3d&amp;post=7437</link><pubDate>Fri, 02 Feb 2007 21:31:11 GMT</pubDate><description>&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ece9d8"&gt;Lets say I have a search page with a grid that I want to populate with fields from 3 different objects, but that I only want a subset of the fields for each object. How do I use WORM to create a query that will return a dataset/xml from this query. I won't be able to return an object because the data I will be returning won't be of any object type that I've created.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ece9d8"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ece9d8"&gt;-meppum&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>Displaying complex data</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2425&amp;key=g99tOt2DaYCkWZ5mfwpmYw%3d%3d&amp;post=7358</link><pubDate>Thu, 21 Dec 2006 16:17:33 GMT</pubDate><description>&lt;P&gt;If you bind to your objects, create a property that aggregates what you need:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;public string FullName {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return String.Format("{0} {1}", _firstname, _lastname;); }&lt;BR&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then bind to your FullName field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Displaying complex data</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2425&amp;key=g99tOt2DaYCkWZ5mfwpmYw%3d%3d&amp;post=7357</link><pubDate>Thu, 21 Dec 2006 16:17:23 GMT</pubDate><description>&lt;P&gt;I'll share my experiences.... I think this is a pretty standard pattern.&lt;/P&gt;
&lt;P&gt;If I'm doing something that does not need to be extermely fast, I'll go ahead and bind a fully "normalized" object graph to a grid / list, taking the performance hit of the multiple queries from lazy loading.&amp;nbsp; I'm refering to "admin" /&amp;nbsp;CRUD type tasks, where it's not going to matter too much if the page takes an extra second or two.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;On the other hand, if I'm populating a list of products one of the main landing pages of a public website for example, I think the page need to load as fast as possible.&amp;nbsp; Caching is ok sometimes, but often you're displaying a search result or data that must be real time.&amp;nbsp; In that case, I will deviate from a pure OO domain model and create a specialized "view" object that has just the necessary read-only properties and can be populated in just one query.&amp;nbsp; For example a "ProductListView" that just consists of an&amp;nbsp;id &amp;nbsp;field, a product name and price fields, maybe one other property and a couple fields from parent or related tables like manufacturer name, or an aggregate like "quantity in stock", etc..&amp;nbsp;&amp;nbsp; Usually&amp;nbsp;these classes&amp;nbsp;are&amp;nbsp;generated from&amp;nbsp;a complex stored procedure rather than an object query or opath query.&amp;nbsp; Alternatively you could create a view in the database for this and query it using opath. These result sets&amp;nbsp;generally need paging which I&amp;nbsp;almost always implement in a stored procedure.&amp;nbsp; (I have not tried the object query paging&amp;nbsp;in sql 2005 yet, which might be fast enough.&amp;nbsp; I know the sql 2000/oledb paging with nested "topped" subqueries works but it's slow as mollases)&amp;nbsp;&amp;nbsp;In my mapping file I just define the object as readonly, autoTracking false, keyType none.&lt;/P&gt;
&lt;P&gt;I never use DataSets to solve this.&lt;/P&gt;
&lt;P&gt;David Martines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Displaying complex data</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2425&amp;key=g99tOt2DaYCkWZ5mfwpmYw%3d%3d&amp;post=7353</link><pubDate>Thu, 07 Dec 2006 15:16:08 GMT</pubDate><description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm wondering how other developers handle complex data presentation in the UI when using WORM. What I mean by complex data is related data (i.e. Customer.Surname, Customer.Orders.OrderRef, Customer.Addresses.Postcode). All too often I will need to display related data in a single datagrid and usually resort to datasets, which I feel breaks the domain model approach. It certainly breaks OO design. I've heard of developers mapping multiple tables to a single class to get around this, but this still doesn't seem like a perfect solution. &lt;/P&gt;
&lt;P&gt;I'd love to hear any&amp;nbsp;thoughts that you all might have&amp;nbsp;on this issue?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Stephen.&lt;/P&gt;</description></item><item><title>GetObject, StartTracking and WeakReferences</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2410&amp;key=GGLlUy2NbVQEbAETpeNHdA%3d%3d&amp;post=7312</link><pubDate>Sun, 03 Dec 2006 01:58:32 GMT</pubDate><description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Actually, perhaps this clarification will provide sufficient detail. &lt;/P&gt;
&lt;P&gt;I have a class called PickList which has a 1:n mapping to PickList Entry. When I call&lt;/P&gt;
&lt;P&gt;PickList pickList = ...GetObject&amp;lt;PickList&amp;gt;(object_guid);&lt;/P&gt;
&lt;P&gt;The pickList object has a List of PickListEntries so I can get&lt;/P&gt;
&lt;P&gt;IList&amp;lt;PickListEntry&amp;gt; pickListEntry = pickList.PickListEntries;&lt;/P&gt;
&lt;P&gt;In our code we carry the pickListEntry reference, but the pickList reference goes out of context and we no longer use it. (This it is probably the weak reference that is GC'd at some point)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your comment was right on the spot, though it took me a while to track down the source. I hope refactoring logic to&amp;nbsp;handle the&amp;nbsp;PickLists (I believe the only place we use such indirect associated object references)&amp;nbsp;will resolve our errors.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for help,&lt;/P&gt;
&lt;P&gt;Suavek Zajac&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>GetObject, StartTracking and WeakReferences</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2410&amp;key=GGLlUy2NbVQEbAETpeNHdA%3d%3d&amp;post=7307</link><pubDate>Sat, 25 Nov 2006 01:59:35 GMT</pubDate><description>&lt;P&gt;The tracking should be maintained as long as the object is being referenced.&amp;nbsp; The only catch I can think of is if you are using an IsolatedContext then your object is being tracked in that context and thus you need to make sure you are also holding onto that same context and using it for persisting.&amp;nbsp; If you are seeing a different behavior then I'll need to see more of your code in order to determine what is happening.&lt;/P&gt;
&lt;P&gt;By the way, the point of IsValid is that it returns true in two cases due to the "or".&amp;nbsp; The first case is that the object itself is still being referenced -- that is the main case by far.&amp;nbsp; The other case only applies if you are using a non-zero "session" -- not the norm by any means.&amp;nbsp; In that case, it also returns true if the object hasn't yet been GC'd and if it was last accessed in a time that is smaller than the "session" time.&amp;nbsp; In any case, once its been GC'd it will not be valid.&lt;/P&gt;
&lt;P&gt;Thanks, Paul Wilson&lt;/P&gt;</description></item><item><title>GetObject, StartTracking and WeakReferences</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2410&amp;key=GGLlUy2NbVQEbAETpeNHdA%3d%3d&amp;post=7305</link><pubDate>Sat, 25 Nov 2006 01:51:03 GMT</pubDate><description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Our team has&amp;nbsp;been using the mapper for the past few weeks in a project and it has performed very well thus far !&lt;/P&gt;
&lt;P&gt;We&amp;nbsp;ran into an issue that involves long running sessions. It seems like Wilson is losing track of our object past a certain point in time. We get an exception indicating that the object is not tracked.&lt;/P&gt;
&lt;P&gt;Now I had checked that our session timeout is 0 (default) and this only happens when we keep&amp;nbsp;objects in memory for a while and then initiate our save process. It happens on objects that we retrieve using the GetObject(&amp;lt;object_id&amp;gt;) call.&lt;/P&gt;
&lt;P&gt;We think(/hope) that we can fix the issue by simply calling GetObject (which I had checked calls StartTracking) just before we persist the object. (We have not been able to reproduce the problem after doing just that). &lt;/P&gt;
&lt;P&gt;I had a brief glance at the Mapper code however; and something had caught my attention. Perhaps I'm missing&amp;nbsp;the big picture&amp;nbsp;but the 'IsValid'&amp;nbsp;Getter in "Instance.cs" appears to falsely inform when the object has been garbage collected. (note the || statement and context.session=0 as it is in the default case)&lt;/P&gt;
&lt;P&gt;public&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;bool&lt;/FONT&gt;&lt;FONT size=2&gt; IsValid {&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;get&lt;/FONT&gt;&lt;FONT size=2&gt; {&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.instance != &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;null&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp;&amp;amp; (&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.instance.IsAlive&lt;/P&gt;
&lt;P&gt;|| &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;DateTime&lt;/FONT&gt;&lt;FONT size=2&gt;.Now.Subtract(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.lastAccess) &amp;lt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.context.Session));&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;So it appears the function returns true regardless&amp;nbsp;of the weak reference having been GC'd. &lt;/P&gt;
&lt;P&gt;Thanks for any info on this matter,&lt;/P&gt;
&lt;P&gt;The mapper saved us lots of time thus far. I hope we can find&amp;nbsp;a resolution to this issue or at least confim that calling GetObject before persisting will do the job.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Suavek Zajac&lt;/P&gt;</description></item><item><title>Web Gardens and WORM</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=1139&amp;key=upwUBXlRNmKyqf5NW%2b073Q%3d%3d&amp;post=7276</link><pubDate>Fri, 10 Nov 2006 19:18:10 GMT</pubDate><description>We use WORM in a high volume ecommerce site&amp;nbsp; 6 server web farm (around 2 million page views/day) each server has dual processor and it seems to be working fine. What really important is how to design your application.&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;N&lt;br&gt;</description></item><item><title>Use actual domain objects or DTOs in remoting</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2332&amp;key=hKO7QEQgojwDbI%2fInlCP6g%3d%3d&amp;post=7155</link><pubDate>Mon, 18 Sep 2006 14:46:21 GMT</pubDate><description>&lt;P&gt;Hi, &lt;/P&gt;
&lt;P&gt;I am just wondering how other people's experience has been in using remoting with the o/r mapper.&amp;nbsp; The main issue I am wondering about is whether to use serializard instances of my domain objects (those that are managed by the o/r mapper) on both the client and server, or if the domain objects should strictly stay on the server and only send DTOs back and forth over the wire.&amp;nbsp; It seems like using the domain objects is feasible as long as the relationships and aggregations are kept to a bare minimum, the objects are serializable, and they are not auto-tracked (use StartTracking only when saving).&amp;nbsp; But of course, you lose the conveneince of having an elaborate graph and the ability to get to a parent's parent's parent just through dot-notation and instead have to&amp;nbsp;make a lot of queries to repositories.&amp;nbsp; That seems like it would adversly affect the readability of some complex business logic.&amp;nbsp; But then again, weigh that against the cost of having to translate your domain objects into and out of DTOs in every call...&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Any comments?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;David Martines&lt;/P&gt;</description></item><item><title>Outer TransactionScope when saving a list of objects in Oracle causes error</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2287&amp;key=0u1EnOr07rP9ahQk%2fxchbA%3d%3d&amp;post=7028</link><pubDate>Wed, 16 Aug 2006 14:32:15 GMT</pubDate><description>When I use a TransactionScope against Oracle I'm running into problems.&amp;nbsp; We create a transaction scope and within it delete a set of data as well as persist a list of objects.&amp;nbsp; When the OR Mapper tries to save the list of objects the following error is thrown:&lt;br&gt;&lt;br&gt;OracleConnection does not support parallel transactions&lt;br&gt;&lt;br&gt;&lt;br&gt;using(TransactionScope tx = new TransactionScope()) {&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; // do operations that delete data&lt;br&gt;&lt;br&gt;&amp;nbsp; // do operation that saves a list of items at once using PersistChanges&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;Is there a way to use TransactionScope with the mapper against Oracle in this type of scenario?&lt;br&gt;</description></item><item><title>Creating Many-To-Many Relationships</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2267&amp;key=lLEew235hZ6aLKVtnNr9mA%3d%3d&amp;post=6996</link><pubDate>Fri, 11 Aug 2006 12:45:28 GMT</pubDate><description>Sorry, but the helper doesn't deduce m-n relationships as they are more involved.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Creating Many-To-Many Relationships</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2267&amp;key=lLEew235hZ6aLKVtnNr9mA%3d%3d&amp;post=6992</link><pubDate>Fri, 11 Aug 2006 12:44:47 GMT</pubDate><description>&lt;P&gt;Is it possible to get the ORMapper Helper to create the m-n relationships (both classes and mappings)? If so, how would I need to set up the db&amp;nbsp;in order to accomplish this? &lt;/P&gt;
&lt;P&gt;I currently have 2 tables (Communities and Advertisements) that need to have a m-n relationship. I created another table (CommunityAdvertisements) that contains only the IDs of the other 2 tables. &lt;/P&gt;
&lt;P&gt;Hopefully, I won't have to do this manually. But if I do, is there an example of classes that represent the relationship that works with the mappings found on this site?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description></item><item><title>Transaction and locking</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2239&amp;key=TxGwLRm%2fNqbA2BspFitmdA%3d%3d&amp;post=6933</link><pubDate>Fri, 21 Jul 2006 19:33:12 GMT</pubDate><description>Hi Madhav:&lt;br&gt;&lt;br&gt;The next version will add GetObjectSet to the Transaction object.&amp;nbsp; In th meantime you'll need to do something else -- which would probably be advisable anyhow if you can since you generally want to avoid locks.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Transaction and locking</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2239&amp;key=TxGwLRm%2fNqbA2BspFitmdA%3d%3d&amp;post=6932</link><pubDate>Fri, 21 Jul 2006 19:26:21 GMT</pubDate><description>&amp;nbsp;&amp;nbsp;&amp;nbsp; I need to lock a row, carry out some processing and then delete the row.&amp;nbsp; I am using the following code.&lt;br&gt;&lt;br&gt;Transaction t = engine.BeginTransaction(System.Data.IsolationLevel.Serializable);&lt;br&gt;// lock the row by updating it&lt;br&gt;t.ExecuteCommand("update Iaf_Event_Store_Forward set Event_timestamp = CURRENT_TIMESTAMP " +&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "where Event_storage_id in (select Min(Event_storage_id) from Iaf_Event_Store_Forward)");&lt;br&gt;// obtain the key&lt;br&gt;int eventStorageId = (int) t.ExecuteScalar("select Min(Event_storage_id) from Iaf_Event_Store_Forward");&lt;br&gt;// try to get the object&lt;br&gt;q1 = new OPathQuery(typeof(IafEventStoreForward), "EventStorageId = ?", "");&lt;br&gt;ObjectSet objEvent = engine.GetObjectSet(q1, eventStorageId); &lt;br&gt;&lt;br&gt;The GetObjectSet gets blocked as it is not part of the same transaction. Is there a way to make it part of the transaction t?&lt;br&gt;&lt;br&gt;Thanks for your help.&lt;br&gt;&lt;br&gt;Madhav Gokhlay&lt;br&gt;</description></item><item><title>how to return my specific fiels in GetObjectSet</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2219&amp;key=sUHsgl8%2bingtock9LCaVNw%3d%3d&amp;post=6868</link><pubDate>Fri, 07 Jul 2006 20:30:10 GMT</pubDate><description>Hi Higor:&lt;br&gt;&lt;br&gt;No, that option only exists for DataSets.&amp;nbsp; Why?&amp;nbsp; Because DataSets are non-typed "generic" containers that can contain any number of fields, while ObjectSets are collections of your strongly-typed objects and must therefore contain all the fields expected for your object.&amp;nbsp; You can get around this by creating two different strong-typed objects, one with all the fields and one with just the ones you want in some situations, with the one inheriting from the other, and then you can choose which type of ObjectSet you want -- but that may be more trouble than its worth.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>how to return my specific fiels in GetObjectSet</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2219&amp;key=sUHsgl8%2bingtock9LCaVNw%3d%3d&amp;post=6865</link><pubDate>Fri, 07 Jul 2006 20:26:33 GMT</pubDate><description>&lt;FONT size=2&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I wrote the code below:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt;[] fields = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt;[] { &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"CategoryId"&lt;/FONT&gt;&lt;FONT size=2&gt; };&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;DataSet&lt;/FONT&gt;&lt;FONT size=2&gt; partContacts = &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Global&lt;/FONT&gt;&lt;FONT size=2&gt;.Manager.GetDataSet(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;typeof&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;Category&lt;/FONT&gt;&lt;FONT size=2&gt;), &lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty, fields);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;And monitored my SQL Server then i saw the query executed:&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;SELECT CategoryId FROM [Categories] ORDER BY CategoryName ASC;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;But I didn´t get the same with GetObjectSet, the query that object Set execute is:&lt;BR&gt;SELECT [Categories].[CategoryId], [Categories].[CategoryName], [Categories].[Description] FROM [Categories]&amp;nbsp;ORDER BY CategoryName ASC;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Can i return just the CategoryId in getObjectSet&amp;nbsp; ?&lt;/P&gt;
&lt;P&gt;Thank You&lt;BR&gt;Higor&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Getting collection back from a transaction.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2198&amp;key=FlegYLmOT5FqNUKQ2eEjhQ%3d%3d&amp;post=6817</link><pubDate>Thu, 22 Jun 2006 23:24:56 GMT</pubDate><description>Oh how I wish I could tell you a specific date.&amp;nbsp; Unfortunately I've been swamped far more than usual lately -- so much so that my client will be hiring someone else to take on some of my responsibities very soon, after which I should have more time.&amp;nbsp; I've also been struggling with some equipment problems, and HP sent me the wrong replacement so its been a long time, but I'm finally "working" on my new machine, which means at least a little more time soon.&amp;nbsp; By "working" I mean I have some things installed and setup, but not everything yet, so there's still a little more time just doing that.&lt;br&gt;&lt;br&gt;Anyhow, my goal is to be putting out frequent "SPs", or Subscriber Previews, kind of like MS' CTPs.&amp;nbsp; I got one out when I started running short of time, so I haven't done anything else in some time now.&amp;nbsp; But the last stuff I did included this feature we're talking about, its just that I was thinking I needed a few more hours to finish another feature also, before getting out that next SP.&amp;nbsp; So if I find a little bit of time in the coming days finally, you may see an SP with what you're looking for -- just keep in mind that SPs are fully tested official releases.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Getting collection back from a transaction.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2198&amp;key=FlegYLmOT5FqNUKQ2eEjhQ%3d%3d&amp;post=6814</link><pubDate>Thu, 22 Jun 2006 23:19:09 GMT</pubDate><description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;Can you be more specific as to the date u mean for next release. cuz if its like months then i will modify the source cod to acheieve my needs or unless u can offer some other alternatives. primarily what i am trying to do is i have temp table in a transaction. and i am trying to get&amp;nbsp; a collection back by joining it to a temp table. that temp table wont be visible outside the scope of the transaction so i need the ability to get a collection back from with in a transaction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Zeeshan&lt;/P&gt;</description></item><item><title>Deadlocking</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2196&amp;key=g3x1VqtnACLUPoqjguWryQ%3d%3d&amp;post=6812</link><pubDate>Thu, 22 Jun 2006 15:03:47 GMT</pubDate><description>Thanks - the nolock hint sounds like it will do the trick.&amp;nbsp; Since some of the operations must insert or update many objects (sometimes over 100), in one case I have resorted to making a very chunky call to the database by using a stored proc.&amp;nbsp; The proc accepts an xml string containing the list of objects to persist and takes care of the inserting within it's own transaction.&amp;nbsp; This is definately a last-resort since it pretty much defeats the purpose of using an ormapper.&amp;nbsp; I&amp;nbsp; plan to re-architect the app to use remoting at some point and run the ormapping assembly right on the db server.&amp;nbsp; This will let the mapper handle the persistence but in much quicker transactions.&lt;br&gt;&lt;br&gt;David&lt;br&gt;</description></item><item><title>Deadlocking</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2196&amp;key=g3x1VqtnACLUPoqjguWryQ%3d%3d&amp;post=6810</link><pubDate>Thu, 22 Jun 2006 09:40:53 GMT</pubDate><description>Hi David:&lt;br&gt;&lt;br&gt;Wow -- that's some significant latency.&amp;nbsp; The next version will allow you to specify locking hints, assuming you're using MS Sql, which will mean that you can force all of your reads to use (nolock) -- that may be sufficient, but it would certainly help if nothing else.&amp;nbsp; In the meantime, you may have to specify a different transaction level as you've noted -- I can't really claim to have the experience with this situation to offer a sure recommendation though.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Deadlocking</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2196&amp;key=g3x1VqtnACLUPoqjguWryQ%3d%3d&amp;post=6799</link><pubDate>Thu, 22 Jun 2006 09:36:56 GMT</pubDate><description>&lt;P&gt;I have a client-server application that uses the ormapper.&amp;nbsp; There are multiple users, but for the most part each user is working on separate data, although the data is in the same tables.&amp;nbsp; The database server is across a VPN, so there is significant latency with all database calls.&amp;nbsp; Some of the operations require inserting or updating multiple records in a single transaction.&amp;nbsp; So if a transaction is taking 5 to 10 seconds to complete, the tables are basically locked during that time, correct?&amp;nbsp; Users are getting frequent deadlock errors.&amp;nbsp; Is the proper way to handle this by using transactionlevel.readuncommited?&amp;nbsp; That seems a little dangerous.&amp;nbsp;Can you reccomend any other strategy?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;David Martines&lt;/P&gt;</description></item><item><title>Getting collection back from a transaction.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2198&amp;key=FlegYLmOT5FqNUKQ2eEjhQ%3d%3d&amp;post=6809</link><pubDate>Thu, 22 Jun 2006 09:36:48 GMT</pubDate><description>Hi Zeeshan:&lt;br&gt;&lt;br&gt;There currently isn't any support for that, but its coming in the next version hopefully.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;&lt;font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;</description></item><item><title>Getting collection back from a transaction.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2198&amp;key=FlegYLmOT5FqNUKQ2eEjhQ%3d%3d&amp;post=6801</link><pubDate>Thu, 22 Jun 2006 09:35:58 GMT</pubDate><description>&lt;P&gt;Hi Paul, &lt;/P&gt;
&lt;P&gt;How am i suppose to get a collection back from an existing transaction. Like in my case for normal cases i am doing &lt;/P&gt;&lt;FONT size=2&gt;
&lt;P&gt;DataManager.ObjectSpace.GetCollection(.. , storedproc);&lt;/P&gt;
&lt;P&gt;however i dont see any option in the transaction class for getting a collection back however there is getdataset. Can you please tell me how i can get a collection back from an existing transaction. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks Zeeshan Hirani&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>capturing the begin and end time of sql statements generated by the ormapper</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2184&amp;key=7EhXOn1W1GtzMKP7YrTbbw%3d%3d&amp;post=6779</link><pubDate>Tue, 13 Jun 2006 20:41:54 GMT</pubDate><description>There is really no easier way than using the sql profiler, and possibly some performance counters that you could setup.&amp;nbsp; The IInterceptCommand exposes the DbCommand object immediately BEFORE its sent to the database so that you can modify it if desired, so its not really designed to measure a time-difference.&amp;nbsp; You may be able to achieve that functionality by modifying the code, and it may not even be drastically hard since the calls in question are pretty much all in Connection, but even then its not trivial since DataReaders won't actually be contained to just that one class.&amp;nbsp; So while its doable, it will be work, and keep in mind that there are existing performance tools that are no doubt going to help you achieve your goals better even if its not your current strategy.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>capturing the begin and end time of sql statements generated by the ormapper</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2184&amp;key=7EhXOn1W1GtzMKP7YrTbbw%3d%3d&amp;post=6778</link><pubDate>Tue, 13 Jun 2006 20:31:14 GMT</pubDate><description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;Can you please tell how i can accomplish capturing the time it took for a sql statement to execute in orampper. I tried looking into IIintercept but it does not have methods like begin sql execution and end sql executioin where i can actually start recording the time and then end recording in the end event and then write that to a log table. I really dont want to be using a profiler cuz i want to accomplish a permanant solution where i can run sql statements in the database on that table to accomplish better optimization techniques. can u please tell what options do i have or how would acheive it in ormapper. i would like to use log4net to record it to the database. i would be&amp;nbsp;nice if you have any example in that area.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description></item><item><title>Where to keep thread-specific IsolatedContext for "global" access?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2180&amp;key=CKrQ2Z5aAQVeVRg0JL6MAA%3d%3d&amp;post=6756</link><pubDate>Mon, 05 Jun 2006 16:06:19 GMT</pubDate><description>All I know for sure, based on that one link, is that the ThreadStatic attribute is better than the NamedDataSlot -- which personally seems very wrong of the CLR team to me, but at least we know now.&amp;nbsp; I'm assuming that Remoting.CallContext would have a higher overhead, but I could be wrong -- I'm basing that on other Remoting things, like ContextBoundObject, definitely having more overhead.&amp;nbsp; Of course sometimes you may not have a choice if you're using remoting.&amp;nbsp; :)&lt;br&gt;&lt;br&gt;As for XP Home and 98, I haven't had the "pleasure" of having to worry about them, but the chart at http://msdn.microsoft.com/library/en-us/dndotnet/html/framewkwinsupp.asp seems to suggest that none of System.Web is going to be supported.&amp;nbsp; I'm not surprised that HttpContext is not supported, but I was pretty sure System.Web.Caching was supported on all platforms -- but it seems even that isn't true afterall.&amp;nbsp; Of course there are still some ways you can first test for an HttpContext using reflection, but I have no clue if that would be a dog on performance for the systems that would support it, so you'll have to test and decide on your own.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Where to keep thread-specific IsolatedContext for "global" access?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2180&amp;key=CKrQ2Z5aAQVeVRg0JL6MAA%3d%3d&amp;post=6754</link><pubDate>Mon, 05 Jun 2006 13:27:07 GMT</pubDate><description>Hi Paul,&lt;br&gt;Thanks for those links.&amp;nbsp; Based on these facts, is it safe to assume that outside of ASP.NET the use of ThreadStatic members is the best way?&amp;nbsp;&amp;nbsp; I am building a domain layer service that shoud be able to run in any of these configurations:&lt;br&gt;&lt;ol&gt;&lt;li&gt;as a remoted object hosted by a windows service&lt;/li&gt;&lt;li&gt;as a remoted object hosted in IIS&lt;/li&gt;&lt;li&gt;as a locally installed component in an ASP.NET site&lt;/li&gt;&lt;li&gt;as a locally installed component in a Windows Forms app.&lt;/li&gt;&lt;/ol&gt;&lt;br&gt;So it looks like having to test for HttpContext is absolutely necessary if I am in configurations 2 and 3, whereas configs 1 and 4 must use a ThreadStatic member.&amp;nbsp; I think I read somewhere that the System.Web assembly is not installed as part of the framework on XP Home or Windows 98.&amp;nbsp; Do you know if that's true?&amp;nbsp; If so, is there any way around that without having to provide a separate compilation for those OS's?&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Where to keep thread-specific IsolatedContext for "global" access?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2180&amp;key=CKrQ2Z5aAQVeVRg0JL6MAA%3d%3d&amp;post=6752</link><pubDate>Mon, 05 Jun 2006 11:22:17 GMT</pubDate><description>Hi David:&lt;br&gt;&lt;br&gt;This is actually a hard question, but only because the facts are not at all obvious.&amp;nbsp; My thought if you had asked this back a year ago would be that you should use a NamedDataSlot, because I didn't want to assume the web HttpContext either, and because I didn't even know about the ThreadStatic attribute.&amp;nbsp; But alas, things are not so simple afterall in web-land, and so now I will tell you what I'm currently doing in my WebPortal code, and why.&lt;br&gt;&lt;br&gt;The first problem is that there are some cases where ASP.NET might switch threads on a single request !&amp;nbsp; I believe its safe to say these cases are rather esoteric and not likely to happen, but its also probably not a good idea for you to assume that no one else will introduce one of those cases when you're designing the architecture for everyone else to use.&amp;nbsp; So like it or not, it turns out to be rather essential to use the web HttpContext, even though you may not feel right about doing that in the layer of your app that is working with ObjectSpaces.&amp;nbsp; (See http://piers7.blogspot.com/2005/11/threadstatic-callcontext-and_02.html for more details on thread-switching.)&lt;br&gt;&lt;br&gt;But maybe you still also have reason to believe there may be someone using your business objects outside of ASP.NET, or maybe your web app also works with non-context threads like mine does (timer-driven events).&amp;nbsp; In that case I think the best thing to do is to have your logic test for the existence of HttpContext.Current, and if it exists then you should use it for the reason stated above.&amp;nbsp; But if it does not exist then it turns out that you should use the ThreadStatic attribute and not a NamedDataSlot due to performance reasons (see http://blogs.msdn.com/junfeng/archive/2005/12/31/508423.aspx for the details).&lt;br&gt;&lt;br&gt;Here's the relevant code from my WebPortal (I removed a few other pieces are aren't immediately relevant):&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;static public class Manager&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static readonly string KEY_Connection = "Wilson.WebPortal.Connection";&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static readonly string KEY_ObjectSpace = "Wilson.WebPortal.ObjectSpace";&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static ObjectSpace db;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Used for non-web-context cases, like timer events or other threads&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// See http://blogs.msdn.com/junfeng/archive/2005/12/31/508423.aspx&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;[ThreadStatic()]&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static ObjectSpace dbContext;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static ObjectSpace DB {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;get {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (Manager.DbContext == null) {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Manager.DbContext = Manager.db.IsolatedContext;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return Manager.DbContext;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Use Context.Items when available, otherwise use thread static variable&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// See http://piers7.blogspot.com/2005/11/threadstatic-callcontext-and_02.html&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;private static ObjectSpace DbContext {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;get {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (HttpContext.Current != null) {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return HttpContext.Current.Items[KEY_ObjectSpace] as ObjectSpace;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return Manager.dbContext;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;set {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (HttpContext.Current != null) {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;HttpContext.Current.Items[KEY_ObjectSpace] = value;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Manager.dbContext = value;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static void ResetContext() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Manager.DbContext = null;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;static Manager() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;string mappingType = "Wilson.WebPortal.Core.ORMaps.config";&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ConnectionStringSettings connection = ConfigurationManager.ConnectionStrings[KEY_Connection];&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Provider provider = (Provider) Enum.Parse(typeof(Provider), connection.ProviderName, true);&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Manager.db = new ObjectSpace(mappingType, connection.ConnectionString, provider);&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson</description></item><item><title>Where to keep thread-specific IsolatedContext for "global" access?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2180&amp;key=CKrQ2Z5aAQVeVRg0JL6MAA%3d%3d&amp;post=6751</link><pubDate>Mon, 05 Jun 2006 10:54:26 GMT</pubDate><description>&lt;P&gt;I've been reading Fowler's Patterns of Enterprise Application Architecture and am quite satisfied that the Wilson ORMapper can fit in nicely with a couple of the patterns in the book.&amp;nbsp; Namely these&amp;nbsp;are UnitOfWork and&amp;nbsp;Repository.&amp;nbsp; Essentially what I want to do is have a UnitOfWork class which wraps the persiting and transactional calls, and several Repository classes which wrap the GetObjectSet and OPath building scenarios.&amp;nbsp; When using a single, application wide-instance of an ObjectSpace, the implementation is fairly trivial - just use a Singleton'd ObjectSpace (Static member).&amp;nbsp; But I am building a server app that basically needs to have one and only one instance of ObjectSpace per "request", or I guess per thread is the more accurate term.&amp;nbsp; Since it is essential that the UnitOfWork and Repositories need to be using the same ObjectSpace instance, which is conveniently provided via IsoloatedContext (I.C.), I need a sort of "global" point of access to get it.&amp;nbsp; I definately don't want to pass around the I.C. in method parameters.&amp;nbsp; So the class that creates the I.C. (the "manager" bascially) has a method&amp;nbsp;returning an&amp;nbsp;I.C. which has the logic of knowing if it needs to create a new I.C. or return an existing one that was created in a previous call to the method but on the same request thread.&amp;nbsp; I think this is the thread-specific Registry pattern in POEAA, which is demontrated using Java-specific&amp;nbsp;code&amp;nbsp;in the book.&amp;nbsp; From my research, it seems there are three or four options for places to stuff the I.C.: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;a static member with the [ThreadStatic] attribute&lt;/LI&gt;
&lt;LI&gt;the System.Runtime.Remoting.CallContext&lt;/LI&gt;
&lt;LI&gt;a NamedDataSlot&lt;/LI&gt;
&lt;LI&gt;the HttpContext.Curent.Items collection&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The HttpContext is probably the best for ASP.NET scenarios, but I denfinately don't want to be referencing System.Web way down in the Domain or Data Access layer.&amp;nbsp; What is your recommended approach?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;David Martines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Navigate ManyToOne relations when persisting with PersistDepth.ObjectGraph.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2133&amp;key=47ZZwivKNnRnectRAqR%2fUQ%3d%3d&amp;post=6727</link><pubDate>Tue, 30 May 2006 00:05:54 GMT</pubDate><description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;That's what&amp;nbsp;we're doing now, and&amp;nbsp;it works.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Wout&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Navigate ManyToOne relations when persisting with PersistDepth.ObjectGraph.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2133&amp;key=47ZZwivKNnRnectRAqR%2fUQ%3d%3d&amp;post=6629</link><pubDate>Wed, 03 May 2006 18:15:59 GMT</pubDate><description>Hi Wout:&lt;br&gt;&lt;br&gt;I realize that there are cases where people feel like the many-to-one object should also be saved, but in my experience that is rare and is also prone to cause other problems since as you note there can be multiple objects referencing the say many-to-one object.&amp;nbsp; So for better or worse I have defined the an object graph as referring to a root object and its mapped one-to-many and many-to-many collections.&amp;nbsp; Even with the many-to-many it actually only saves the "linkings" and not the actual objects on the other side of the many-to-many.&amp;nbsp; This is pretty consistent with some other mappers, although I cannot claim to know if there are others that do something more or not -- but I do believe there are a lot of potential issues should some do more.&lt;br&gt;&lt;br&gt;So what are the alternatives?&amp;nbsp; In some cases you can consider the many-to-one object your root object, but that won't work in many cases.&amp;nbsp; The other recommendation I have is to use an explicit transaction -- see ObjectSpace.BeginTransaction and then call Transaction.PersistChanges for both your root and any many-to-one objects that are changed, followed of course by Transaction.Commit.&amp;nbsp; Its a little more work, but it should be relatively easy to include in your application if this scenario is something your application allows.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson</description></item><item><title>Navigate ManyToOne relations when persisting with PersistDepth.ObjectGraph.</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2133&amp;key=47ZZwivKNnRnectRAqR%2fUQ%3d%3d&amp;post=6628</link><pubDate>Wed, 03 May 2006 18:06:13 GMT</pubDate><description>&lt;P&gt;Hi Paul,&lt;/P&gt;
&lt;P&gt;I have object A referencing object B, but possibly more than one A instance reference a single B instance. So this is a many to one relation ship (and one could say B is the parent of A, though this feels unnatural since A is my 'root' object referencing other objects). Anyways, my "problem" is that when storing object A with PersistDepth.ObjectGraph, I'd intuitively expect that A is stored, and also B is stored. However, it seems that because B is viewed as the parent, the graph is not navigated 'upwards', and B is not stored. However, when taking the viewpoint that all tracable references as seen from A, I'd say that B should also be stored. That other A's are also referencing B should be of no concern, B has no references to A, so that's where the persisting should end.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Wout&lt;/P&gt;
&lt;P&gt;E-mail: wout at woutware dot com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Denormalized tables into heirarchies?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2125&amp;key=N4Zzr4%2bPkxT0M%2fkiunqTVQ%3d%3d&amp;post=6607</link><pubDate>Tue, 02 May 2006 15:31:04 GMT</pubDate><description>I would do something similar along the lines of the adaptor pattern.&amp;nbsp; First you would create an object that is similar in structure (if not the same) as your legacy table and map it.&amp;nbsp; Then you would expose those private legacy internals publicly in the more OO manner you expect.&amp;nbsp; You may be able to do that with just that one class, but you may find it better to have separate classes to represent the legacy and "correct" structures -- there's no right answer to me, although some purists would always create separate classes (maybe even a 3rd to actually do the adapting).&amp;nbsp; The point is that there isn't going to be a way to have any O/R Mapper "convert" your data from a legacy format -- that's more your job.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Denormalized tables into heirarchies?</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2125&amp;key=N4Zzr4%2bPkxT0M%2fkiunqTVQ%3d%3d&amp;post=6606</link><pubDate>Tue, 02 May 2006 15:25:11 GMT</pubDate><description>&lt;P&gt;I often run into pre-existing legacy databases that aren't properly normalized. It might have something like OrderID, CustomerID, Product1ID, Product1Name, Product2ID, Product2Name, Product3ID, Product3Name.&lt;/P&gt;
&lt;P&gt;What I would like is some way to turn that into an Order object with a collection of&amp;nbsp;Product objects without having to hit the database multiple time to get the same row. How would I&amp;nbsp;layout my mapping file to do that?&lt;/P&gt;
&lt;P&gt;Tim Gray&lt;BR&gt;&lt;A href="mailto:tgray@geniant.com"&gt;tgray@geniant.com&lt;/A&gt;&lt;/P&gt;</description></item><item><title>Secondary sort</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2100&amp;key=nLqdsaLg5PfG6%2bbk21Ezrw%3d%3d&amp;post=6535</link><pubDate>Fri, 21 Apr 2006 15:12:05 GMT</pubDate><description>Absolutely.&amp;nbsp; You can either specify a default sortOrder in the mapping file for that entity (sortOrder="Field1, Field2, ..."), and/or you can specify a query specific sort clause in the ObjectQuery (or OPathQuery).&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item><item><title>Secondary sort</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2100&amp;key=nLqdsaLg5PfG6%2bbk21Ezrw%3d%3d&amp;post=6534</link><pubDate>Fri, 21 Apr 2006 15:09:33 GMT</pubDate><description>&lt;P&gt;Is it possible to do a secondary sort on a table?&amp;nbsp;&amp;nbsp;For example, if you have a list of people, is it possible to sort on LastName, FirstName (similar to the order by clause in a sql statement)?&amp;nbsp; BTW, this product is great, thanks for all your work!&lt;/P&gt;</description></item><item><title>Inheritance problems</title><link>http://wilsonormapper.com/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2086&amp;key=bRpHKqcRzqizpoybyi2jQg%3d%3d&amp;post=6503</link><pubDate>Tue, 18 Apr 2006 12:20:03 GMT</pubDate><description>For completeness sake, I'll note the problem here also.&amp;nbsp; It turns out to be a simple typo -- it should be "subEntity" and not "subentity" -- note that xml is case sensitive.&amp;nbsp; So the entire SysAdmin stuff was totally ignored here.&lt;br&gt;&lt;br&gt;Thanks, Paul Wilson&lt;br&gt;</description></item></channel></rss>