|
From: NHibernate J. <mik...@us...> - 2007-01-08 16:04:34
|
Inconsistent need of the Flush method invokation
------------------------------------------------
Key: NH-853
URL: http://jira.nhibernate.org/browse/NH-853
Project: NHibernate
Type: Bug
Components: Core =20
Versions: 1.2.0.Beta2 =20
Reporter: Andr=C3=A9s G. Aragoneses
Priority: Trivial
Attachments: NHibBugAboutFlush.zip
I have managed to create a simple NHibernate testcase which creates some ob=
jects and all the operations are done successfully without the FLUSH method=
invokation *except* the many-to-many relation creations.
I am attaching the testcase as a VS2005 solution. Note the following line i=
n Program.cs:
//if this line is commented, the table TERMINALS_TERMINALGROUPS=
is not persisted! but the rest yes
oSession.Flush();
P.S.: Be sure to add the NHibernate DLL's to the 'Lib' directory (and to th=
e bin/Debug ones) when uncompressing.
P.S.2: Don't pay attention to the name of the solution. It's for another bu=
g I am going to open.
--=20
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|
|
From: NHibernate J. <mik...@us...> - 2007-01-08 16:44:31
|
[ http://jira.nhibernate.org/browse/NH-853?page=3Dall ] =20 Sergey Koshcheyev closed NH-853: -------------------------------- Resolution: Not an Issue This is not an issue with NHibernate, NH has to perform identity inserts ri= ght away to be able to return an identifier to you. Even in that case, you = are advised to call Flush explicitly. > Inconsistent need of the Flush method invokation > ------------------------------------------------ > > Key: NH-853 > URL: http://jira.nhibernate.org/browse/NH-853 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Andr=C3=A9s G. Aragoneses > Priority: Trivial > Attachments: NHibBugAboutFlush.zip > > I have managed to create a simple NHibernate testcase which creates some = objects and all the operations are done successfully without the FLUSH meth= od invokation *except* the many-to-many relation creations. > I am attaching the testcase as a VS2005 solution. Note the following line= in Program.cs: > //if this line is commented, the table TERMINALS_TERMINALGROU= PS is not persisted! but the rest yes > oSession.Flush(); > P.S.: Be sure to add the NHibernate DLL's to the 'Lib' directory (and to = the bin/Debug ones) when uncompressing. > P.S.2: Don't pay attention to the name of the solution. It's for another = bug I am going to open. --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: NHibernate J. <mik...@us...> - 2007-01-08 19:18:38
|
[ http://jira.nhibernate.org/browse/NH-853?page=3Dcomments#action_1473= 7 ] =20 Ayende Rahien commented on NH-853: ---------------------------------- Hehe, I had the _exact_ same response as you did about a year ago, for the same r= eason. To expand a bit on Sergey's comment, the issue is that NH has to go to the = DB as soon as you Save() an object that has Identity PK. This may lead into situations where stuff seems to work, even without a flu= sh. Consider such things as bugs in your code. In the future, NHibernate is going to move to a mode where it will only do = Identity Inserts when in a transaction, so this is something to consider. > Inconsistent need of the Flush method invokation > ------------------------------------------------ > > Key: NH-853 > URL: http://jira.nhibernate.org/browse/NH-853 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Andr=C3=A9s G. Aragoneses > Priority: Trivial > Attachments: NHibBugAboutFlush.zip > > I have managed to create a simple NHibernate testcase which creates some = objects and all the operations are done successfully without the FLUSH meth= od invokation *except* the many-to-many relation creations. > I am attaching the testcase as a VS2005 solution. Note the following line= in Program.cs: > //if this line is commented, the table TERMINALS_TERMINALGROU= PS is not persisted! but the rest yes > oSession.Flush(); > P.S.: Be sure to add the NHibernate DLL's to the 'Lib' directory (and to = the bin/Debug ones) when uncompressing. > P.S.2: Don't pay attention to the name of the solution. It's for another = bug I am going to open. --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
|
From: NHibernate J. <mik...@us...> - 2007-01-09 14:09:32
|
[ http://jira.nhibernate.org/browse/NH-853?page=3Dcomments#action_1475= 8 ] =20 Andr=C3=A9s G. Aragoneses commented on NH-853: ----------------------------------------- Thanks for the comments. BTW, regarding the Ayende's one: "In the future, NHibernate is going to mov= e to a mode where it will only do Identity Inserts when in a transaction", = why don't we close then this issue in that future? I think this behaviour m= ay be confusing for newcomers so, at least, we could reference them to this= "UNRESOLVED" feature. > Inconsistent need of the Flush method invokation > ------------------------------------------------ > > Key: NH-853 > URL: http://jira.nhibernate.org/browse/NH-853 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Andr=C3=A9s G. Aragoneses > Priority: Trivial > Attachments: NHibBugAboutFlush.zip > > I have managed to create a simple NHibernate testcase which creates some = objects and all the operations are done successfully without the FLUSH meth= od invokation *except* the many-to-many relation creations. > I am attaching the testcase as a VS2005 solution. Note the following line= in Program.cs: > //if this line is commented, the table TERMINALS_TERMINALGROU= PS is not persisted! but the rest yes > oSession.Flush(); > P.S.: Be sure to add the NHibernate DLL's to the 'Lib' directory (and to = the bin/Debug ones) when uncompressing. > P.S.2: Don't pay attention to the name of the solution. It's for another = bug I am going to open. --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |