No, it isn't. The Universe will collapse if you do. There may also be some 
inconsistencies in tracked entities.

RP

On Monday, November 9, 2015 at 11:35:29 AM UTC, Ibn De Witt wrote:
>
> Hi there. 
>
> Just wanted to ask if open an ISession on one thread and then access it 
> from another if that's safe to do. There is no concurrent access happening. 
>
> Why do i ask? 
>
> I use akka.net and i have a DBAccessActor that opens up an ISession, 
> begins a transaction with snapshot isolation level and has a criteria query 
> created in that session/transaction when it gets created from the actor 
> system. This session/transaction is kept open until the actor gets killed 
> of when it is done working. For each "process" message the actor receives 
> it retrieves another batch of records via paging (that's why i need to have 
> a snapshot transaction and keep it open. it is important for me in that 
> case.) and sends those off to another actor to do stuff with. 
>
> Now i was told that it can happen that this actor, in some rare cases, can 
> have its message processing be moved to another thread. So basically 
> another thread would access that ISession instance. Is this going to be a 
> problem?
>
> Because message handling in actors is sequential there's never any 
> concurrent access happening on that ISession so thread-safety shouldn't be 
> an issue here.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to