SpringSource/spring-net — pull request #22 by hailtondecastro (2012-06-09 05:07:52+00:00)
Title: Workaround for 'conversation scope' and "session-per-conversation".

Integration of new features sugested and posted in https://jira.springsource.org/browse/SPRNET-1431.

Below is the transcript. At the time, the implementation was made to SPRING.NET 1.3.0. The difference is that now was included in version 2 (it does not demanded significant changes).

Transcription:

"

I worked on an Workaround for 'conversation scope' on 'Spring.Net 1.3.0'.

The problem is well known: In some situations it is necessary that the objects are not as durable as the as those of "session scope" and not as volatile as those of "request scope".

I suggest the implementation attached. The tests are included.

Basically I considered the following features:

Start / End of Conversation;
Nested conversations;
Conversation timeout;
"session-per-converastion" (NHibernate)
"session-per-converastion" pattern:
When a conversation with a 'hibernate Session' is started/resumed
the session is created/reconnected.
Some limitations exists:
1) Participating in existing Hibernate SessionFactory IS NOT ALOWED. In the same way, 'Deferred close' IS NOT ALOWED.
2) Only one conversation can have 'true' value in "ISession.IsConnected" for its ISession simultaneously.

I took into consideration what I found in the following references:

http://www.google.com.br/search?hl=pt&q=%22conversation+scope%22&btnG=Pesquisar
http://majureconsulting.com/Site/Home_files/conversationscope.pdf
http://www.google.com.br/search?q=conversation+site%3Aforum.springframework.net&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:pt-BR:official&client=firefox-a
http://forum.springframework.net/showthread.php?t=5385&page=2
http://forum.springframework.net/showthread.php?t=3714
For build and tests, you can use 'vs2005' or 'vs2008 express'
Dependences:
Targhet Framework: '.Net Framework 2.0'
Spring.Conversation:
-..\lib\spring\lib\Common.Logging.dll (1.2.0.0)
-..\lib\nhibernate\Iesi.Collections.dll (1.0.1.0)
-..\lib\nhibernate\NHibernate.dll (2.1.2.4000)
-..\lib\spring\Spring.Core.dll (1.3.0.20349)
-..\lib\spring\Spring.Data.dll (1.3.0.20349)
-..\lib\spring\Spring.Data.NHibernate21.dll (1.3.0.20349)
Spring.Conversation.Test:
-..\lib\spring\lib\Common.Logging.dll (1.2.0.0)
-..\lib\spring\lib\Common.Logging.Log4Net.dll (1.2.0.2)
-..\lib\log4net.dll (1.2.10.0)
-..\lib\nunit.framework.dll (2.4.7.0)
-..\lib\NUnitAspEx.dll (2.0.4100.26265)
-..\lib\spring\Spring.Core.dll (1.3.0.20349)
-..\lib\spring\Spring.Data.dll (1.3.0.20349)
-..\lib\spring\Spring.Web.dll (1.3.0.20349)
-(GAC)\System.Data.SQLite (1.0.66.0) (http://sqlite.phxsoftware.com/) (http://sourceforge.net/projects/sqlite-dotnet2/files/SQLite%20for%20ADO.NET%202.0/1.0.66.0/SQLite-1.0.66.0-setup.exe/download)

Sorry for some spelling errors. I do not speak English very well.
Cheers, Hailton de Castro.

"