It's a "foreign key" in the sense that it references a "record in another table", but for opensim assetID it's only an uuid to be served for the "asset server", not for being recovered directly from the database. That is, you could set a foreign key in your database model (I did it last year when starting with nhibernate, but I was playing in standalone mode) but asset management and inventory management are independent.<br>
<br>When you are in "grid" mode you will have 5 UGAIM + X region servers, each one with its data model and you could be using different schemas/database servers/machines/networks...<br><br>If you need to implement a process to take care of referencial integrity between assets and inventory I think (please "masters of the opensim" correct me if I'm wrong) you must implement the "look for shit" process in the inventory server and a REST delete method in the assets server, but taking care with the things you delete, you must be absolutely sure that the asset you are deleting is ONLY and inventory item (and not library asset, region map, terrain, etc.). It isn't anything similar right now (at least not in the 0.6 version I am working on)<br>
<br>The implementation of the asset server is very simple, extremely simple (I did it with less than 100 php code lines.. well... using a mvc framework :-P ). It only has get and save... by now, of course.<br><br>I think was Adam Frisby? who made a new asset server with authentication and some other things like storing into amazon's S3 (my memory fails often) but I don't know if this implements something like delete or modify.<br>
<br>So... maybe you need to create the methods for yourself or wait for the next evolution of opensim. If you want to develope them, my advice is to include the possibility to deactivate the behavior (config file or something).<br>
<br>Greetings<br><br><br><br><div class="gmail_quote">2009/3/3 Frank W Sweet <span dir="ltr"><<a href="mailto:fwsweet@backintyme.com">fwsweet@backintyme.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Impalah wrote: The connection between them is<br>
<div class="im">assetID(inventoryItems)->id(assets) but there aren't any foreign keys.<br>
<br>
</div>The asset UUID in the inventory record is a foreign key. Located in<br>
one table (inventoryitems), it is the unique key to an entry in a<br>
different table (assets). The problem, in this specific example, is<br>
that if the asset record is copied whenever it is modified, for fear<br>
that some other inventory item might be pointing to it, eventually<br>
most of the asset records in my database will be junk--not referenced<br>
by any item and so unreachable. Worse yet, due to glitches and<br>
crashes, an inventory item might be pointing to a non-existent<br>
asset-ID. (Now that I know the data structure, I have already found<br>
several such situations in my database.)<br>
<font color="#888888"><br>
Frank W Sweet<br>
Backintyme Publishing.<br>
</font><div class="im"><br>
----- Original Message -----<br>
From: "Impalah" <<a href="mailto:impalah@gmail.com">impalah@gmail.com</a>><br>
To: "Frank W Sweet" <<a href="mailto:fwsweet@backintyme.com">fwsweet@backintyme.com</a>>;<br>
<<a href="mailto:opensim-users@lists.berlios.de">opensim-users@lists.berlios.de</a>><br>
</div><div><div></div><div class="h5">Sent: Tuesday, March 03, 2009 9:12 AM<br>
Subject: Re: [Opensim-users] Database overview needed<br>
<br>
<br>
Not, there aren't any, at least in the "original" opensim servers.<br>
<br>
Asset server is a huge store of anything, even the generated maps and<br>
terrain revisions (opensim region servers). Not only inventory assets<br>
are<br>
stored there.<br>
<br>
Asset server and inventory server are separated processes each one<br>
with<br>
their own data models. The connection between them is<br>
assetID(inventoryItems)->id(assets) but there aren't any foreign keys.<br>
You<br>
could use different databases for assets/inventory.<br>
<br>
I have only doubts about the new AssetsInventory server, I hadn't time<br>
to<br>
play with it.<br>
<br>
Greetings<br>
<br>
2009/3/3 Frank W Sweet <<a href="mailto:fwsweet@backintyme.com">fwsweet@backintyme.com</a>><br>
<br>
> Thank you so much! I had no idea that section of the Wiki was out<br>
> there!<br>
><br>
> One other question: Since there is no reference counter in "asset"<br>
> for<br>
> inventory-to-asset references (nor in "userfriend" for<br>
> user-to-userfriend references, nor in any other table receiving<br>
> one-to-many relationships, for that matter), I assume that there are<br>
> utility procedures in the code that are run periodically to purge<br>
> unreferenced records and to check referential integrity. Where in<br>
> the<br>
> code would these be, and how often are they run (at startup,<br>
> shutdown,<br>
> every so often)?<br>
><br>
> Frank W Sweeet<br>
> Backintyme Publishing<br>
><br>
> ----- Original Message -----<br>
> From: "Jeff Ames" <<a href="mailto:jeffames@gmail.com">jeffames@gmail.com</a>><br>
> To: "Frank W Sweet" <<a href="mailto:fwsweet@backintyme.com">fwsweet@backintyme.com</a>>;<br>
> <<a href="mailto:opensim-users@lists.berlios.de">opensim-users@lists.berlios.de</a>><br>
> Sent: Monday, March 02, 2009 10:58 PM<br>
> Subject: Re: [Opensim-users] Database overview needed<br>
><br>
><br>
> There is some existing documentation at<br>
> <a href="http://opensimulator.org/wiki/Database:Documentation" target="_blank">http://opensimulator.org/wiki/Database:Documentation</a> and the pages<br>
> linked there.<br>
><br>
> As for assets versus inventory items, an asset is the object itself,<br>
> whereas the inventory item simply points to the asset (via the asset<br>
> ID), and adds some information about the asset that the inventory<br>
> needs to be aware of, such as permissions.<br>
><br>
> When assets are modified, a copy is created, since we can't be sure<br>
> that there is only one reference to the original asset.<br>
><br>
> (I believe this is accurate, but those of you more familiar with<br>
> current asset handling, please correct me if I'm mistaken.)<br>
><br>
> Jeff<br>
><br>
> _______________________________________________<br>
> Opensim-users mailing list<br>
> <a href="mailto:Opensim-users@lists.berlios.de">Opensim-users@lists.berlios.de</a><br>
> <a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
><br>
<br>
</div></div></blockquote></div><br>