Click here to Skip to main content
15,921,279 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unwanted resizing in Button components Pin
Christian Graus30-Mar-09 0:28
protectorChristian Graus30-Mar-09 0:28 
GeneralRe: Unwanted resizing in Button components Pin
roza_gh30-Mar-09 0:58
roza_gh30-Mar-09 0:58 
QuestionC# with Ms Access , Crystal Reports and Windows Application. Pin
jimish129-Mar-09 21:44
jimish129-Mar-09 21:44 
AnswerRe: C# with Ms Access , Crystal Reports and Windows Application. Pin
Greg Chelstowski29-Mar-09 23:26
Greg Chelstowski29-Mar-09 23:26 
GeneralRe: C# with Ms Access , Crystal Reports and Windows Application. Pin
jimish130-Mar-09 1:41
jimish130-Mar-09 1:41 
QuestionWhich free Antivirus can remove this: WORM_KLEZ.E Pin
Rao Rafique29-Mar-09 21:34
Rao Rafique29-Mar-09 21:34 
AnswerRe: Which free Antivirus can remove this: WORM_KLEZ.E Pin
Pete O'Hanlon29-Mar-09 21:45
mvePete O'Hanlon29-Mar-09 21:45 
Questionwho killed my app!? [modified] Pin
devvvy29-Mar-09 21:26
devvvy29-Mar-09 21:26 
hello, Can NHibernate exit your app without throwing an exception?

I'm debugging a console app and
<br />
void main(...)<br />
{<br />
try {<br />
IPerson oParent = LoadPerson(123);<br />
<br />
} catch(Exception ex)<br />
{<br />
   Console.WriteLine(ex.ToString()); // this was never hit!?<br />
}<br />
return;<br />
}<br />
<br />
public IPerson LoadPerson(long nId)<br />
...<br />
try {<br />
<br />
// DAO call which uses NHibernate ISession.Get(nId). Then "Children" are retrieved by another mechanism, but initial ISession.Get and subsequent loading of children are two separate member functions wrapped under single transaction scope (i.e. not NHibernate... long story short, it uses a self-referencing table to hold parent-child relationship. This table uses a different mapping file. Retrieved oChild.Parent is set to oParent which I think is... the primarily culprit)<br />
<br />
using (oScope = new TransactionScope(TransactionScopeOption.Required))<br />
{<br />
   IPerson oParent = Session.Get(nId);<br />
<br />
   LoadChildren(oParent);<br />
<br />
  foreach(IPerson oChild in oParent.Children)<br />
  {<br />
     oChild.Parent = oParent; // If I comment out this line my app won't "exit silently" (not immediately, but after exit from "LoadPerson")!! Question is why!?<br />
<br />
    oChild.Parent = new Person(); // Event this would save the app from silently exiting (after exit from "LoadPerson")<br />
<br />
  }<br />
}<br />
<br />
} catch (Exception ex)<br />
{<br />
   Console.WriteLine(ex.ToString()); // this was never hit?!<br />
}<br />
<br />
returns oParent;<br />
}<br />


Any suggestion as to posssibility of NHibernate causing my WIN32 console app to exit silently? I have catch(Exception) on all levels but still I didn't manage to catch any exception and therefore don't know what killed it... I initially suspected loading children is a recursive ops but if infinitely recursion was the cause of death I should have a StackOverflowException do I? But I have nothing. I understand you can't "catch" a StackOverflowException" but still if you run app on debugger, debugger will be able to tell you that under all circumstances right? (I tested this on another simple toy app)

I am most suspicious you can't really assigned oParent to Child.Parent attribute within same transaction scope - even though oParent loaded first.
<br />
oChild.Parent = oParent;<br />



Many thanks.

dev

modified on Monday, March 30, 2009 4:04 AM

AnswerRe: who killed my app!? Pin
Pete O'Hanlon29-Mar-09 21:58
mvePete O'Hanlon29-Mar-09 21:58 
QuestionVisual C# 2005 Application Error: Please reply Urgent Pin
Rao Rafique29-Mar-09 21:14
Rao Rafique29-Mar-09 21:14 
AnswerRe: Visual C# 2005 Application Error: Please reply Urgent Pin
SeMartens29-Mar-09 21:28
SeMartens29-Mar-09 21:28 
AnswerRe: Visual C# 2005 Application Error: Please reply Urgent Pin
#realJSOP29-Mar-09 23:45
professional#realJSOP29-Mar-09 23:45 
QuestionStatic Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
Prasanth MS29-Mar-09 21:08
Prasanth MS29-Mar-09 21:08 
AnswerRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
SeMartens29-Mar-09 21:25
SeMartens29-Mar-09 21:25 
GeneralRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
Prasanth MS29-Mar-09 21:56
Prasanth MS29-Mar-09 21:56 
GeneralRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
SeMartens29-Mar-09 22:11
SeMartens29-Mar-09 22:11 
GeneralRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
Prasanth MS29-Mar-09 22:24
Prasanth MS29-Mar-09 22:24 
GeneralRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
SeMartens29-Mar-09 22:44
SeMartens29-Mar-09 22:44 
AnswerRe: Static Vs. Non-Static Connection - C#, SQL Servier in a Multi-User Environment Pin
Luc Pattyn30-Mar-09 1:19
sitebuilderLuc Pattyn30-Mar-09 1:19 
QuestionHow to implement IClassFactory2 in C# library? Pin
Member 471608729-Mar-09 20:54
Member 471608729-Mar-09 20:54 
AnswerRe: How to implement IClassFactory2 in C# library? Pin
Christian Graus29-Mar-09 21:02
protectorChristian Graus29-Mar-09 21:02 
AnswerRe: How to implement IClassFactory2 in C# library? Pin
Pete O'Hanlon29-Mar-09 22:12
mvePete O'Hanlon29-Mar-09 22:12 
Questionnotification ballon tip Pin
AlexPizzano29-Mar-09 20:39
AlexPizzano29-Mar-09 20:39 
AnswerRe: notification ballon tip Pin
Xmen Real 29-Mar-09 21:49
professional Xmen Real 29-Mar-09 21:49 
QuestionGenerating formatted file Pin
Andy Rama29-Mar-09 19:53
Andy Rama29-Mar-09 19:53 

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.