NHibernate 2.1.2.GA & Oracle

Oramai sta per uscire la versione 3 ma solo ora mi sono spostato alla versione 2.1.2.GA (l’ultima stabile da usare in produzione).

Penso di fare cosa utile a più di una persona a postare la configurazione per della session factory per usare questa versione di NHibernate con Oracle XE.

   1: Dim cfg As New Configuration()
   2: Dim props As IDictionary(Of String, String) = New Dictionary(Of String, String)
   3: With props
   4:     .Add(Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider")
   5:     .Add(Environment.Dialect, "NHibernate.Dialect.Oracle10gDialect")
   6:     .Add(Environment.ConnectionDriver, "NHibernate.Driver.OracleDataClientDriver")
   7:     .Add(Environment.ConnectionString, "Data Source=XE;Persist Security Info=True;User ID=myUsername;Password=myPassword")
   8:     .Add(Environment.Isolation, "ReadCommitted")
   9:     .Add(Environment.QuerySubstitutions, "true 1, false 0, yes 'Y', no 'N'")
  10:     .Add(Environment.ShowSql, "True")
  11:     .Add(Environment.ProxyFactoryFactoryClass, "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle")
  12:     .Add(Environment.Hbm2ddlKeyWords, "none")
  13: End With
  14: Try
  15:     With cfg
  16:         .SetProperties(props)
  17:         .AddAssembly("MyAssembly")
  18:         factory = .BuildSessionFactory()
  19:     End With
  20: Catch ex As Exception
  21:     Throw (ex)
  22: End Try

Avete ovviamente la possibilità di scegliere la  ProxyFactoryFactoryClass che preferite.

Grazie ad Andrea per il supporto.

Technorati Tags: ,,

posted @ mercoledì 25 agosto 2010 03:23

Print
Comments have been closed on this topic.
«aprile»
domlunmarmergiovensab
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011