I'm not quite clear on how you plan to integrate this into opensim. Will it be via interfaces like current db systems are. So a call is made on the interface asking the db system to store that object. Or are you planning on having these nhibernate objects directly in the core. <br><br>I'm really unsure of that, if that is the plan, as it ties the core to nhibernate without any chance of implementing a non nhibernate based storage system. I think we should have interfaces like currently ,but of course improved and more standardised. That would have a call like StorageAsset(AssetBase asset). But we can't rely on AssetBase asset being of type NHibernateAssetData. As that again would be restricting us to nhibernate.<br><br> Maybe AssetBase isn't the best example of what I'm thinking. But if we had NhibernateSceneObjectGroup. We couldn't expect all SceneObjectGroup objects in the core to be of that sub type. As what if a Module add some sceneobjects and just used the base
 type. <br><br><br><br><br> <b><i>Sean Dague <sean@dague.net></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> I've starting baby steps in building an OpenSim.Data.NHibernate driver<br>(I'm very close to getting NHiberate + Mono + SQLite working).  I did<br>look at Impalah's work here, but that created a lot of intermediary<br>objects that I wanted to avoid.  After chatting with Stephan yesterday,<br>wanted to give people a flavor of how this works, as we'll need to make<br>a few changes in the base to make our objects NHibernate friendly.<br><br>It turns out the NHibernate + Mono + SQLite is actually the hardest<br>thing to get working, as NHibernate 1.2.1 doesn't have an SQLite driver<br>that works with Mono.  Step one was to write one, which I've done.  Once<br>this is proofed out a bit more we'll need to do an import of NHibernate<br>1.2.1 branch into opensim-libs and add in the
 driver.  I'll also be<br>submitting the driver upstream to NHibernate in a hopes we could get a<br>1.2.2 with it included so we don't have to keep our own tree here.<br><br>My first test case here is Assets.  Asset storage is easy, as we just<br>store AssetBase.  It's 8 fields, which include an LLUUID, a Blob, and<br>some other types, which also makes it good at testing we can do all the<br>types we need to do.<br><br>AssetBase is what I call a "naked object".  Today all access is done via<br>direct attribute modification, which is actually worst practice in the<br>area.  For NHibernate to work correctly we need to have all our storable<br>data objects use Properties for data modification.  Honestly, we should<br>have been doing this anyway.  We're going to break Grid Comms<br>compatibility when we make this change, because the default<br>serialization of AssetBase will change.<br><br>Once this is done you create a mapping file.  This is an embedded<br>resource of
 OpenSim.Data.NHibernate.  The AssetBase mapping file is<br>here:<br>http://opensimulator.org/hg/opensim-trunk/file/8566c030a9bf/OpenSim/Data/NHibernate/Resources/AssetBase.hbm.xml<br><br>http://opensimulator.org/hg/opensim-trunk/file/8566c030a9bf/OpenSim/Data/NHibernate/NHibernateAssetData.cs<br>is the Asset Store work in progress.  It should just save assets right<br>now (though there is a transaction bug with sqlite I need to sort out).<br><br>In order to have this code work for a different database you just change<br>the driver declaration lines in 60 - 65 (can be done via runtime<br>config).  Any of the ~20 databases supported by NHibernate could then be<br>used instead.  Lines 68 - 71 gives you automatic db creation.  It does a<br>drop/create each time it is run, so is something we'll only want for<br>initial create, not used every time.<br><br>Right now I'm fighting with a transaction bug with SQLite, which I've<br>got a few ideas on how to get around.  Once that's
 fixed on store, I'll<br>fill out the rest of the asset implementation.  My goal is to be running<br>my Asset db on NHibernate + SQLite by end of the week, and to have all<br>that work in tree so others can kick the tires.<br><br>There are plenty of unanswered questions here, but having finally gotten<br>my head wrapped around the space, I really like the direction this is<br>headed.  The fact that NHibernate is also an actively developed project,<br>and things like automatic schema upgrades are coming in the future (they<br>already exist in Hibernate, the java project that NHibernate is based<br>on), is something we'll definitely want to take advantage of.<br><br>     -Sean<br><br>-- <br>__________________________________________________________________<br><br>Sean Dague                                       Mid-Hudson Valley<br>sean at dague dot net                            Linux Users Group<br>http://dague.net                                
 http://mhvlug.org<br><br>There is no silver bullet.  Plus, werewolves make better neighbors<br>than zombies, and they tend to keep the vampire population down.<br>__________________________________________________________________<br>_______________________________________________<br>Opensim-dev mailing list<br>Opensim-dev@lists.berlios.de<br>https://lists.berlios.de/mailman/listinfo/opensim-dev<br></blockquote><br><p>



      <hr size=1> 
Yahoo! for Good helps you <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51947/*http://uk.promotions.yahoo.com/forgood/">make a difference</a>