[Opensim-dev] nhibernate progress, baby steps

Brian Wolfe brianw at terrabox.com
Thu Apr 3 16:19:58 UTC 2008


*nod* sounds good to me as well. I just have one request since we'll be
changing things up at this level. Can we shoot for UUIDs being stored as
a byte[16] in order to gain the 10x speedup in SQL indexing/storage vs
string(32|36) ?


On Thu, 2008-04-03 at 16:17 +0100, Michael Wright wrote:
> ahh okay that sounds fine. I just wasn't sure if you were talking
> about having the nhibernate code (for storing via nhibernate) directly
> in the core classes. As I believe was talked about some time ago. But
> yeah making classes use Properties rather than Public variables is
> something we should be doing anyway.
> 
> Sean Dague <sean at dague.net> wrote:
>         On Thu, Apr 03, 2008 at 03:05:31PM +0100, Michael Wright
>         wrote:
>         > 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.
>         > 
>         > 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.
>         
>         It goes into the standard OpenSim.Data.* model that happens
>         today. No
>         changes to the data layer there at this point.
>         
>         > 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.
>         
>         As an example, this is what a NHibernate friendly AssetBase
>         looks like.
>         Notice, there is really nothing NHibernate specific about
>         this. Code
>         wise it is binary compatible (just attributes replaced by
>         properties).
>         Someone that knows how serialization works could tell me
>         whether or not
>         the serialization will be the same. I added one convenience
>         property so
>         that we can get/set UUID as a string. SceneObjectGroup/Part
>         already
>         looks much more like this, and I think probably won't need any
>         changes.
>         
>         using System;
>         using libsecondlife;
>         
>         namespace OpenSim.Framework
>         {
>         [Serializable]
>         public class AssetBase
>         {
>         private byte[] _data;
>         private LLUUID _fullid;
>         private sbyte _type;
>         private sbyte _invtype;
>         private string _name = String.Empty;
>         private string _description = String.Empty;
>         private bool _local = false;
>         private bool _temporary = false;
>         
>         public AssetBase()
>         {
>         }
>         
>         public AssetBase(LLUUID assetId, string name)
>         {
>         FullID = assetId;
>         Name = name;
>         }
>         
>         public virtual LLUUID FullID {
>         get { return _fullid; }
>         set { _fullid = value; }
>         }
>         
>         public virtual string ID {
>         get { return _fullid.ToString(); }
>         set { _fullid = new LLUUID(value); }
>         }
>         
>         public virtual byte[] Data {
>         get { return _data; }
>         set { _data = value; }
>         }
>         
>         public virtual sbyte Type {
>         get { return _type; }
>         set { _type = value; }
>         }
>         
>         public virtual sbyte InvType {
>         get { return _invtype; }
>         set { _invtype = value; }
>         }
>         
>         public virtual string Name {
>         get { return _name; }
>         set { _name = value; }
>         }
>         
>         public virtual string Description {
>         get { return _description; }
>         set { _description = value; }
>         }
>         
>         public virtual bool Local {
>         get { return _local; }
>         set { _local = value; }
>         }
>         
>         public virtual bool Temporary {
>         get { return _temporary; }
>         set { _temporary = value; }
>         }
>         }
>         }
>         
>         -Sean
>         
>         -- 
>         __________________________________________________________________
>         
>         Sean Dague Mid-Hudson Valley
>         sean at dague dot net Linux Users Group
>         http://dague.net http://mhvlug.org
>         
>         There is no silver bullet. Plus, werewolves make better
>         neighbors
>         than zombies, and they tend to keep the vampire population
>         down.
>         __________________________________________________________________
>         _______________________________________________
>         Opensim-dev mailing list
>         Opensim-dev at lists.berlios.de
>         https://lists.berlios.de/mailman/listinfo/opensim-dev
> 
> 
> 
> 
> ______________________________________________________________________
> Sent from Yahoo! Mail. 
> A Smarter Inbox.
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev




More information about the Opensim-dev mailing list