aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateAssetData.cs
diff options
context:
space:
mode:
authorSean Dague2008-04-23 19:13:06 +0000
committerSean Dague2008-04-23 19:13:06 +0000
commita1cc0e436ff9081f3c0a76de861ed0673cd36142 (patch)
tree31d775f3e17109b5b6765e89b73da9f036172328 /OpenSim/Data/NHibernate/NHibernateAssetData.cs
parent* Fix a console issue where pressing return on some operating systems cause t... (diff)
downloadopensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.zip
opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.gz
opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.bz2
opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.xz
changes to allow asset_source to be specified in the opensim.ini
this will work for sqlite and nhibernate, but will be ignored for mysql and mssql (reverting to their ini files) until someone writes that bit.
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateAssetData.cs')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
index db90d09..7bd4a0b 100644
--- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
@@ -50,18 +50,24 @@ namespace OpenSim.Data.NHibernate
50 50
51 public override void Initialise() 51 public override void Initialise()
52 { 52 {
53 // TODO: hard coding for sqlite based stuff to begin with, just making it easier to test 53 Initialise("SQLiteDialect;SqliteClientDriver;URI=file:Asset.db,version=3");
54 }
54 55
56 public override void Initialise(string connect)
57 {
58 // TODO: hard coding for sqlite based stuff to begin with, just making it easier to test
59 char[] split = {';'};
60 string[] parts = connect.Split(split);
61
55 // This is stubbing for now, it will become dynamic later and support different db backends 62 // This is stubbing for now, it will become dynamic later and support different db backends
56 cfg = new Configuration(); 63 cfg = new Configuration();
57 cfg.SetProperty(Environment.ConnectionProvider, 64 cfg.SetProperty(Environment.ConnectionProvider,
58 "NHibernate.Connection.DriverConnectionProvider"); 65 "NHibernate.Connection.DriverConnectionProvider");
59 cfg.SetProperty(Environment.Dialect, 66 cfg.SetProperty(Environment.Dialect,
60 "NHibernate.Dialect.SQLiteDialect"); 67 "NHibernate.Dialect." + parts[0]);
61 cfg.SetProperty(Environment.ConnectionDriver, 68 cfg.SetProperty(Environment.ConnectionDriver,
62 "NHibernate.Driver.SqliteClientDriver"); 69 "NHibernate.Driver." + parts[1]);
63 cfg.SetProperty(Environment.ConnectionString, 70 cfg.SetProperty(Environment.ConnectionString, parts[2]);
64 "URI=file:Asset.db,version=3");
65 cfg.AddAssembly("OpenSim.Data.NHibernate"); 71 cfg.AddAssembly("OpenSim.Data.NHibernate");
66 72
67 HbmSerializer.Default.Validate = true; 73 HbmSerializer.Default.Validate = true;