private static ISessionFactory _sessionTrabFactory;
private static ISessionFactory SessionTrabFactory
{
get
{
if(_sessionTrabFactory == null)
{
var configuration = new Configuration();
configuration.Configure("hbtrab.cfg.xml");
configuration.AddFile("Caixa.hbm.xml");
configuration.AddFile("Contas.hbm.xml");
configuration.AddFile("Lancamentocaixa.hbm.xml");
configuration.AddFile("Saldocaixa.hbm.xml");
configuration.AddFile("Produto.hbm.xml");
//new SchemaExport(configuration).Create(true, true);
_sessionTrabFactory =
configuration.BuildSessionFactory();
}
return _sessionTrabFactory;
}
}
public static IStatelessSession OpenStatelessSessionTrab()
{
return SessionTrabFactory.OpenStatelessSession();
}
2010/11/30 Fabio Maulo <[email protected]>
> from where it come ?
>
> On Tue, Nov 30, 2010 at 3:58 PM, Everton Lucas <[email protected]> wrote:
>
>> Session is an object of IStatelessSession.
>>
>> 2010/11/30 Fabio Maulo <[email protected]>
>>
>> Possible non-threadsafe access to the session
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>> From where come the session ?
>>>
>>> On Tue, Nov 30, 2010 at 3:23 PM, Everton Lucas <[email protected]>wrote:
>>>
>>>> Hi Folks
>>>>
>>>> The last message I sent was resolved. At this moment, I've got the error
>>>> above. This error happens when the code, which follows below, runs. Someone
>>>> could help me?
>>>>
>>>> public Conta GetByNumConta(string num)
>>>> {
>>>> Conta contaEncontrada = null;
>>>> string pattern = "^[0-9]{4}([.]{0,1}[0-9]{4})*$";
>>>> if (!System.Text.RegularExpressions.Regex.IsMatch(num,
>>>> pattern))
>>>> throw new ArgumentException();
>>>> string[] codigosContas = num.Split('.');
>>>> int? id = null;
>>>> foreach(string conta in codigosContas)
>>>> {
>>>> string query;
>>>> if (id == null)
>>>> query = "from Conta cta where cta.NumConta = '" +
>>>> conta + "' and cta.ContaPai = null";
>>>> else
>>>> query = "from Conta cta where cta.NumConta = '" +
>>>> conta + "' and cta.ContaPai = " + id.ToString();
>>>> contaEncontrada =
>>>> session.CreateQuery(query).UniqueResult<Conta>();
>>>> if (contaEncontrada != null)
>>>> id = contaEncontrada.Id;
>>>> else
>>>> id = null;
>>>> }
>>>> return contaEncontrada;
>>>> }
>>>>
>>>> --
>>>> Best Regards
>>>> Everton Lucas
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "nhusers" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected]<nhusers%[email protected]>
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/nhusers?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>> Fabio Maulo
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "nhusers" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<nhusers%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/nhusers?hl=en.
>>>
>>
>>
>>
>> --
>> Abraço
>>
>> Everton Lucas
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>
>
> --
> Fabio Maulo
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
--
Abraço
Everton Lucas
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.