aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateAssetData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
index e52f633..875f4e5 100644
--- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
@@ -97,14 +97,14 @@ namespace OpenSim.Data.NHibernate
97 string regex = @"no such table: Assets"; 97 string regex = @"no such table: Assets";
98 Regex RE = new Regex(regex, RegexOptions.Multiline); 98 Regex RE = new Regex(regex, RegexOptions.Multiline);
99 try { 99 try {
100 using(ISession session = factory.OpenSession()) { 100 using (ISession session = factory.OpenSession()) {
101 session.Load(typeof(AssetBase), LLUUID.Zero); 101 session.Load(typeof(AssetBase), LLUUID.Zero);
102 } 102 }
103 } catch (ObjectNotFoundException) { 103 } catch (ObjectNotFoundException) {
104 // yes, we know it's not there, but that's ok 104 // yes, we know it's not there, but that's ok
105 } catch (ADOException e) { 105 } catch (ADOException e) {
106 Match m = RE.Match(e.ToString()); 106 Match m = RE.Match(e.ToString());
107 if(m.Success) { 107 if (m.Success) {
108 // We don't have this table, so create it. 108 // We don't have this table, so create it.
109 new SchemaExport(cfg).Create(true, true); 109 new SchemaExport(cfg).Create(true, true);
110 } 110 }
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate
113 113
114 override public AssetBase FetchAsset(LLUUID uuid) 114 override public AssetBase FetchAsset(LLUUID uuid)
115 { 115 {
116 using(ISession session = factory.OpenSession()) { 116 using (ISession session = factory.OpenSession()) {
117 try { 117 try {
118 return session.Load(typeof(AssetBase), uuid) as AssetBase; 118 return session.Load(typeof(AssetBase), uuid) as AssetBase;
119 } catch { 119 } catch {
@@ -125,8 +125,8 @@ namespace OpenSim.Data.NHibernate
125 override public void CreateAsset(AssetBase asset) 125 override public void CreateAsset(AssetBase asset)
126 { 126 {
127 if (!ExistsAsset(asset.FullID)) { 127 if (!ExistsAsset(asset.FullID)) {
128 using(ISession session = factory.OpenSession()) { 128 using (ISession session = factory.OpenSession()) {
129 using(ITransaction transaction = session.BeginTransaction()) { 129 using (ITransaction transaction = session.BeginTransaction()) {
130 session.Save(asset); 130 session.Save(asset);
131 transaction.Commit(); 131 transaction.Commit();
132 } 132 }
@@ -137,8 +137,8 @@ namespace OpenSim.Data.NHibernate
137 override public void UpdateAsset(AssetBase asset) 137 override public void UpdateAsset(AssetBase asset)
138 { 138 {
139 if (ExistsAsset(asset.FullID)) { 139 if (ExistsAsset(asset.FullID)) {
140 using(ISession session = factory.OpenSession()) { 140 using (ISession session = factory.OpenSession()) {
141 using(ITransaction transaction = session.BeginTransaction()) { 141 using (ITransaction transaction = session.BeginTransaction()) {
142 session.Update(asset); 142 session.Update(asset);
143 transaction.Commit(); 143 transaction.Commit();
144 } 144 }