Workaround for 'conversation scope' and "session-per-conversation". #22

Merged
merged 17 commits into from Dec 31, 2012

Conversation

Projects
None yet
3 participants
Contributor

hailtondecastro commented Jun 9, 2012

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 integrated into 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.

"

hailtondecastro added some commits Jun 9, 2012

@hailtondecastro hailtondecastro Correction to be able to find the location of the MONO in "Win 7 64." 7481387
@hailtondecastro hailtondecastro Ensure use of 32 bits version of frameworks and IDE to avoid the error
[MSB6003: The specified task executable "ResGen.exe" could not be
run...] on "Win 7 64".
  Forcing use of specific SDK to avoid the error "TRK0002: Failed to
execute command ResGen ..." on "Win 7 64". See:
http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/e8c1d26a-5e77-4422-bbc8-f0b7f25702d2/
  Specifying mandatory property (Platform) in SDK 7.
fe115c2
@hailtondecastro hailtondecastro Conversation Workaround (Core Implementation) 8385655
@hailtondecastro hailtondecastro Conversation Workaround (Tests) d14b754
@hailtondecastro hailtondecastro Correct OutputPath to 2010 folder c833d8a
@hailtondecastro hailtondecastro Support for Windows XP in other languages. In Portuguese, for example,
is "c:\Arquivos de Programs".
5a4010f
@hailtondecastro hailtondecastro Ensuring destination with $(ProjectDir). b8a2eca
@hailtondecastro hailtondecastro Adapting 'NHobernate.Northwind' to Conversation. 98c0d81
@hailtondecastro hailtondecastro Conversation Workaround (Tests) 0d47c71
@hailtondecastro hailtondecastro Correct OutputPath to 2010 folder 44181c8
@hailtondecastro hailtondecastro Correct OutputPath to 2010 folder 5d99093
@hailtondecastro hailtondecastro Correct OutputPath to 2010 folder 854b198
@hailtondecastro hailtondecastro Support for Windows XP in other languages. In Portuguese, for example,
is "c:\Arquivos de Programs".
0fa1849
@hailtondecastro hailtondecastro Support for Windows XP in other languages. In Portuguese, for example,
is "c:\Arquivos de Programs".
'lib.dir.relative' to use in others build's.
'Spring.ConversationWA.NH32.build', 'Spring.ConversationWA.NH33.build',
'ConversationWA.NH32.Tests.build' and 'ConversationWA.NH33.Tests.build'.
b0a57ac
@hailtondecastro hailtondecastro Conversation projects. 65a97f3
@hailtondecastro hailtondecastro ignore '.project' for eclipse. 126b609
@hailtondecastro hailtondecastro Support for serialization of the conversation.
Support for serialization of the conversation. Clustering capability for
an application that use this "workaround conversation".
Previously, the implementation of the "Conversation Workaround" was not
capable of serialization. Thus, it was impossible to clustering
applications who used this approach.

These properties will no longer be loaded by direct injection:
"WebConversationManager.SessionFactory",
"WebConversationSpringState.SessionFactory" and
"WebConversationSpringState.DbProvider".
Now we will use this properties:
"WebConversationManager.SessionFactoryName",
"WebConversationSpringState.SessionFactoryname" and
"WebConversationSpringState.DbProviderName". The load of
"ISessionfactory" and "IDbProvider" will be made indirectly by classes
"WebConversationSpringState" and "WebConversationSpringState".
62758ce

@sbohlen sbohlen merged commit 62758ce into spring-projects:master Dec 31, 2012

lahma added this to the 2.0 milestone Mar 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment