Support Stateless Session

30 views
Skip to first unread message

Rob#

unread,
Nov 23, 2009, 6:46:23 PM11/23/09
to S#arp Architecture
Hi,
I am new to sharp-arch. I am trying to do bulk insert for which I
wanted use the IStatelessSession.
Could you please let me know if the sharp-arch does support this at
the moment?

Asbjørn Ulsberg

unread,
Nov 24, 2009, 12:38:03 PM11/24/09
to sharp-arc...@googlegroups.com
Can you provide code on how you would do this outside of S#arp
Architecture? If an IStatelessSession is obtainable through vanilla
NHibernate, it should be so through S#arp as well.


-Asbjørn
> --
>
> You received this message because you are subscribed to the Google
> Groups "S#arp Architecture" group.
> To post to this group, send email to sharp-arc...@googlegroups.com.
> To unsubscribe from this group, send email to
> sharp-architect...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sharp-architecture?hl=.

Rob#

unread,
Nov 24, 2009, 2:03:44 PM11/24/09
to S#arp Architecture
Thanks for your reply.
Here is how we can insert data using IStatelessSession.

using (IStatelessSession statelessSession =
sessionFactory.OpenStatelessSession())
using (ITransaction transaction =
statelessSession.BeginTransaction()) {

foreach (var testObject in testObjects) {
statelessSession.Insert(testObject);
}
transaction.Commit();
}

Now, on the action of a controller how would I use this code.
The SharpArch.Data.NHibernate.NHibernateSession class on the SharpArch
has got all the methods where it creates the Configuration.
It does not seem to have any method that works with IStatelessSession.

Please advice.



Now, if I want to put this in a action, how would I get the

On 24 Nov, 17:38, Asbjørn Ulsberg <asbjo...@gmail.com> wrote:
> Can you provide code on how you would do this outside of S#arp  
> Architecture? If an IStatelessSession is obtainable through vanilla  
> NHibernate, it should be so through S#arp as well.
>
> -Asbjørn
>

Asbjørn Ulsberg

unread,
Nov 25, 2009, 2:44:49 PM11/25/09
to sharp-arc...@googlegroups.com
Aha, I see.

So the problem isn't with creating the stateless session, but with passing
it around inside S#arp Architecture code? If that's the case, it makes
sense. It shouldn't be much work to create the overloads required to build
in support for this, though.


-Asbjørn
> http://groups.google.com/group/sharp-architecture?hl=en.
Reply all
Reply to author
Forward
0 new messages