|
|
Comments and Discussions
|
|
 |
|
|
|

|
Hi,
I've been wanting to ask you this for a while now...
How would you implement a Parent/Child structure in Raptor DB. For example, let's say we have a document type 'pcDocument' that can have "children" or "parents" of the same type. I tried creating a List of pcDocument in the object definition, but that doesn't work...so after a little trial and error I figured out a way to get I what I want, it's not a very efficient way of doing it (due to multiple queries required to extract structure) but it's does work.
So we set up our document class with an ID, and whatever fields we want to store (name,description, whatever) and a List of childDocuments, childDocument stores the ID of the "child document":
#region [ class definitions ]
public class pcDocument
{
public pcDocument()
{
ID = Guid.NewGuid();
}
public Guid ID { get; set; }
public string documentName { get; set; }
public List<childDocument> Children { get; set; }
}
public class childDocument
{
public Guid pcDocumentID { get; set; }
}
#endregion
Then I can use something like this to get a List of children:
public static Result<pcDocumentView.RowSchema> getChildDocuments(Guid parentDocumentID)
{
Result<pcDocumentView.RowSchema> retval = new Result<pcDocumentView.RowSchema>();
System.Text.StringBuilder linqQuery = new System.Text.StringBuilder();
var q = rap.Query<childDocumentView.RowSchema>(c => c.docid == parentDocumentID);
foreach (childDocumentView.RowSchema child in q.Rows)
{
linqQuery.AppendLine("docid = \"" + child.pcDocumentID.ToString() + "\"");
linqQuery.AppendLine("OR");
}
if (linqQuery.ToString().Length>0)
{
string slinqQuery = linqQuery.ToString().Substring(0, linqQuery.ToString().Length - 6);
retval = Program._rap.Query<pcDocumentView.RowSchema>(slinqQuery);
}
return retval;
}
I can use something similar to get a list of Parents for a given childDocumentID.
It's a bit stupid and real ugly...but it's the best I could come up with. Do you have any suggestions for a better method?
Thanks
*edit: corrections
modified 15-Mar-13 15:30pm.
|
|
|
|

|
Hi Mehdi,
I was trying to get NotEqual (!=) working in a Raptor query, and when it didn't work I looked into the code and found that in LINQQuery.cs VisitBinary method ExpressionType.NotEqual is tested for but not handled in the else if, and in LINQString.cs VisitBinary ExpressionType.NotEqual is commented out. Is NotEqual not implemented?
Thanks
|
|
|
|

|
When querying for string values, it appears that the query engine is case sensitive. So, if a record exists with the fileName 12345678 and fileExtension .txt and I perform the following test:
string fname="12345678";
string fext = ".TXT";
var q = rap.Query<ssDocumentView.RowSchema>(f=> f.fileName==fname && f.fileExtension==fext);
MessageBox.Show(q.Count.ToString());
It returns 0 rows, if I change fext to ".txt" it returns 1 row (the correct value).
Is this by design? If so, is there any way to do a case-insensitive query?
|
|
|
|

|
When i query on the document type i get this exception
System.InvalidCastException : Unable to cast object of type 'RowSchema' to type 'SampleViews.SalesInvoice'
var qq = rap.Query(typeof(SalesInvoice));
foreach (SalesInvoice item in qq.Rows)
According to the article i can query on view type or document type. I can query on the view but not on the document type. I also tried the new query syntax for the document type as well, but got System.InvalidOperationException : Stack empty.
rap.Query<SalesInvoice>(x => true);
There are no concrete examples of querying the document type to prove this is possible.
|
|
|
|

|
I know object updates are appended to the database (not overwritten) but what about files?
If if save a file using rap.SaveBytes(g,b[]) is the previous version of this file retained? If so, do you plan to offer a method to retrieve these previous versions?
|
|
|
|

|
Hey,
So I was noticing that the size of my storage file was increasing a lot more than I would have expected it to. When you do the following:
Sample temp = DB.Fetch(DocID);
temp.Values.Add("new value");
DB.Save(temp, temp.ID);
Is the old instance of temp with the ID DocID in the storage file overwritten, or is the old instance kept and the updated object just appended to the storage file? I read on codeplex your justification of the delete behavior and in it you mentioned that the storage files were implemented to be append only which might be why I'm having issues.
What I'm seeing is that I have an object that contains a list which I append to every few minutes and I then write back this object to the DB. After about 250 iterations of adding to this list I'm serializing this object to a JSON string and writing this to a text file, which ends up being about 10MB in size. This size is reasonable for this object which stores a large amount of data but what I notice is that the size of the data.mgdat file has increased to about 1.5GB. Does this sound like the correct behavior?
|
|
|
|
|

|
Are Save/Fetch Bytes supported in Server Mode? When I savebytes the return value is true, but attempting to fetchbytes returns null. Are there any other feature differences between embedded and server modes that I should be aware of?
Thanks
|
|
|
|

|
Hey,
I'm seeing an issue if I start up RaptorDB in server mode, then write to the database from the same process that started the DB in server mode. I'm able to write to the DB running in server mode from a separate process/exe with no problems.
Some sample code below.
Console.WriteLine("Starting DB in server mode");
RaptorDBServer server = new RaptorDBServer(90, "_data");
Console.WriteLine("Connecting to DB in server mode");
IRaptorDB DB = new RaptorDBClient("localhost", 90, "admin", "admin");
Sample obj = new Sample(){
Name = "Object",
OtherValue = "Other value for object 1"
};
DB.Save(obj.ID, obj);
DB.Shutdown();
server.Shutdown();
The exception is in the DB log which I've included below.
2012-12-17 11:39:09|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\bin\Debug\_data\
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-17 11:39:09|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-17 11:39:10|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-17 11:39:10|DEBUG|1|RaptorDB.RaptorDBServer|| loading dll for views : C:\testRaptorDB\bin\Debug\Extensions\testLib.dll
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| Rebuilding view from scratch...
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| View = SampleView
2012-12-17 11:39:11|DEBUG|1|RaptorDB.Views.ViewHandler|| rebuild done (s) = 0
2012-12-17 11:39:16|ERROR|7|RaptorDB.RaptorDBServer|| System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'testLib.SampleView' to type 'RaptorDB.View`1[testLib.Sample]'.
at RaptorDB.Views.ViewHandler.Insert[T](Guid guid, T doc) in c:\RaptorDB\v1.9.0\RaptorDB\Views\ViewHandler.cs:line 132
at RaptorDB.Views.ViewManager.Insert[T](String viewname, Guid docid, T data) in c:\v1.9.0\RaptorDB\Views\ViewManager.cs:line 191
at RaptorDB.RaptorDB.SaveInPrimaryView[T](String viewname, Guid docid, T data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDB.cs:line 508
at RaptorDB.RaptorDB.Save[T](Guid docid, T data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDB.cs:line 128
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at RaptorDB.RaptorDBServer.processpayload(Object data) in c:\RaptorDB\v1.9.0\RaptorDB\RaptorDBServer.cs:line 102
2012-12-17 11:39:17|DEBUG|4|RaptorDB.Common.NetworkServer|| tcp connects/sec = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 3.9208
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-17 11:39:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-17 11:39:17|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-17 11:39:17|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-17 11:39:17|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-17 11:39:18|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
|
|
|
|

|
I trying this against v1.9.0
I'm unable to retrieve all results for a certain type in Server mode but it does work in embedded mode fine.
My object and view definition are here:
public class Sample
{
public Guid ID;
public string Name;
public string OtherValue;
public Sample()
{
}
}
[RegisterView]
public class SampleView : View<Sample>
{
public class RowSchema : RDBSchema
{
public string Name;
}
public SampleView()
{
this.Name = "SampleView";
this.Description = "A primary view for sample objects";
this.isPrimaryList = true;
this.isActive = true;
this.BackgroundIndexing = false;
this.Schema = typeof(SampleView.RowSchema);
this.AddFireOnTypes(typeof(Sample));
this.Mapper = (api, docid, doc) =>
{
api.EmitObject(docid, doc);
};
}
}
I've tried a number of different query formats and they're all working against the DB running in Embedded mode but not when I access it in Server mode. I've included a test case and all the query formats I've tried below. The query formats I've tried are:
DB.Query("SampleView"); DB.Query(typeof(Sample)); DB.Query(typeof(SampleView)); DB.Query(typeof(SampleView.RowSchema));
DB.Query("SampleView", (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(Sample), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query(typeof(SampleView.RowSchema), (SampleView.RowSchema v) => v.Name == "Object"); DB.Query<SampleView.RowSchema>(v => v.Name == "Object"); DB.Query<SampleView.RowSchema>("Name = \"Object\"");
I'm getting 3 different behaviors for the query formats when run against the DB in Server mode, these are
- I get back a Result<object> list with a size of 0
- I get back a null result
- I get the following exception
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
at RaptorDB.RaptorDBClient.GenericResult[T](Result`1 res) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 475
at RaptorDB.RaptorDBClient.Query[T](Expression`1 filter, Int32 start, Int32 c
ount) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 469
at RaptorDB.RaptorDBClient.Query[T](Expression`1 filter) in c:\RaptorDB\v1.9.0\RaptorDB.Common\RaptorDBClient.cs:line 455
at testRaptorDB.Program.ReadAllObjects() in c:\testRaptorDB\testRaptorDB\Program.cs:line 104
I've written a test case to demonstrate my issue below. I compiled it, copied the dll with the Sample object and SampleView definitions into the "Extensions" directory and then ran the test case with the various query formats I specified above (which are available but commented out in the test case). Am I do anything obviously wrong? I'm just looking for any way of fetching all objects of a particular type from the database while running in Server mode.
using System;
using System.Linq;
using System.IO;
using RaptorDB;
using RaptorDB.Common;
class Program
{
static int waitTime = 5;
static string dataPath = "_data";
static IRaptorDB DB = null;
static Sample[] SampleArray =
{
new Sample
{
ID = Guid.NewGuid(),
Name = "Object",
OtherValue = "other value for object 1"
},
new Sample
{
ID = Guid.NewGuid(),
Name = "Object",
OtherValue = "other value for object 2"
}
};
public static void Main(string[] args)
{
Console.WriteLine("Delete database directory if it already exists");
Directory.Delete(dataPath, true);
Console.WriteLine("Connecting to DB in embedded mode");
DBInit();
WriteSampleData();
Wait();
ReadAllObjects();
Console.WriteLine("Closing DB in embedded mode");
DB.Shutdown();
Console.WriteLine("Starting DB in server mode");
RaptorDBServer server = new RaptorDBServer(90, dataPath);
Console.WriteLine("Connecting to DB in server mode");
DB = new RaptorDBClient("localhost", 90, "admin", "admin");
ReadAllObjects();
DB.Shutdown();
server.Shutdown();
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
static void DBInit()
{
Console.WriteLine("Initialise database");
RaptorDB.RaptorDB rapDB = RaptorDB.RaptorDB.Open(dataPath);
rapDB.RegisterView( new SampleView());
DB = rapDB;
}
static void WriteSampleData()
{
foreach(Sample obj in SampleArray)
{
Console.WriteLine("{0} : {1} : {2}", obj.ID.ToString(), obj.Name, obj.OtherValue);
DB.Save(obj.ID, obj);
}
}
static void ReadAllObjects()
{
Console.WriteLine("Read back all data from DB\n");
try
{
var list = DB.Query("SampleView");
if(list.Count > 0)
{
Console.WriteLine("-- {0} SampleView retrieved", list.Count);
foreach(SampleView.RowSchema row in list.Rows)
{
Console.WriteLine("-- ViewRow {0}: {1}", row.docid.ToString(), row.Name);
Console.WriteLine("");
}
}
else
Console.WriteLine("-- 0 SampleView retrieved");
}
catch(Exception e)
{
Console.WriteLine("Error: {0}", e.ToString());
}
}
static void Wait()
{
Console.Write("\nWait a few seconds to make sure records are written");
for(int i =0; i< waitTime; i++)
{
Console.Write(".");
System.Threading.Thread.Sleep(1000);
}
Console.WriteLine("\n");
}
}
Command Line Output
Delete database directory if it already exists
Connecting to DB in embedded mode
Initialise database
3ae79e98-b64e-4a64-99bc-98d697105630 : Object : other value for object 1
978e9367-2299-4a9c-9c45-536957840fc5 : Object : other value for object 2
Wait a few seconds to make sure records are written.....
Read back all data from DB
-- 2 SampleView retrieved
-- ViewRow 3ae79e98-b64e-4a64-99bc-98d697105630: Object
-- ViewRow 978e9367-2299-4a9c-9c45-536957840fc5: Object
Closing DB in embedded mode
Starting DB in server mode
Connecting to DB in server mode
Read back all data from DB
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at testRaptorDB.Program.ReadAllObjects() in c:\testRaptorDB\testRaptorDB\Program.cs
Log file from DB directory
2012-12-10 05:49:11|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-10 05:49:11|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| Rebuilding view from scratch...
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| View = SampleView
2012-12-10 05:49:12|DEBUG|1|RaptorDB.Views.ViewHandler|| rebuild done (s) = 0
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query : SampleView
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query rows fetched (ms) : 10.7833
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| query rows count : 2
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 2.9409
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last record = 1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-10 05:49:17|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-10 05:49:17|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-10 05:49:17|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:17|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:18|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:18|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:18|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-10 05:49:18|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:18|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:18|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:18|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-10 05:49:19|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:19|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-10 05:49:19|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:19|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:19|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB starting...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDB|| RaptorDB data folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 2
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Current Count = 0
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Checking Index state...
2012-12-10 05:49:20|DEBUG|1|RaptorDB.KeyStore`1|| Starting save timer
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue starting
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Hoot|| Starting hOOt....
2012-12-10 05:49:20|DEBUG|1|RaptorDB.Hoot|| Storage Folder = C:\testRaptorDB\testRaptorDB\bin\Debug\_data\Data\Fulltext\
2012-12-10 05:49:20|DEBUG|1|RaptorDB.RaptorDBServer|| loading dll for views : C:\testRaptorDB\testRaptorDB\bin\Debug\Extensions\testLib.dll
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| byte[] is null
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| curr rec = 2
2012-12-10 05:49:21|DEBUG|5|RaptorDB.RaptorDB|| last rec = 2
2012-12-10 05:49:21|DEBUG|6|RaptorDB.Views.ViewHandler|| query : SampleView
2012-12-10 05:49:21|DEBUG|6|RaptorDB.Views.ViewHandler|| query :
2012-12-10 05:49:21|ERROR|6|RaptorDB.RaptorDBServer|| Expression expected (at index 0)
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Hoot|| saving index...
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Hoot|| save time (ms) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last full text record = -1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last record = 2
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| last backup record = -1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.RaptorDB|| Shutting down
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewManager|| View Manager shutdown
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.TaskQueue|| TaskQueue shutdown
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewManager|| shutting down view : SampleView
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down Viewhandler
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : docid
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.Views.ViewHandler|| Shutting down view index : Name
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| saving to disk
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total split time (s) = 0
2012-12-10 05:49:22|DEBUG|1|RaptorDB.MGIndex`1|| Total pages = 1
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| index saved
2012-12-10 05:49:22|DEBUG|1|RaptorDB.IndexFile`1|| Shutdown IndexFile
2012-12-10 05:49:22|DEBUG|1|RaptorDB.BitmapIndex|| Shutdown BitmapIndex
2012-12-10 05:49:22|DEBUG|1|RaptorDB.KeyStore`1|| Shutting down log
|
|
|
|

|
I am very impressed with the DB and I notice in your article that you have a Silverlight 5 demo screenshot but when looking at the source code you don't include support for compiling Silverlight 5 projects.
Does RaptorDB in fact work with Silverlight 5 and do you have a version of the source code that supports it?
Graeme
|
|
|
|

|
Hi,
How do I, using your example of a SalesInvoice with SalesItems, retrieve the list of SalesItems for a particular SalesInvoice? I must be missing something, because when I try to add the Items list to the Invoice view I get a Constraint error. This must be possible, but how?
Thanks
modified 28-Nov-12 17:25pm.
|
|
|
|

|
Looks really impressive I'm look forward to trying it out. thanks for all the hard work
|
|
|
|
|

|
It's fascinating - I must try it ...
|
|
|
|

|
I haven't tried Raptor yet, but one of the comments stated that things are never really deleted, so does that mean that the database just continues to get bigger?
If so, what do you do?
|
|
|
|

|
Hi,
Loving RaptorDB and it is working well for me but one thing i don't think i have seen anywhere is how raptorDB deals with changes to enities as updates to the application are released. I am talking about adding or removing properties or renaming properties. What will RaptorDB do? Will it just save the extra fields and drop the data for the missing ones or will it raise errors? Is there some method of been able to update data from an old to new schema/entity?
|
|
|
|

|
Hi Mehdi,
You have built some great stuff, you have 2 very different licenses on Codeplex (GPL) and CodeProject (CPOL). CPOL is very permissive, i.e. you can use it for virtually any purpose. The GPL is very restrictive, would love to use the library in some projects but the GPL puts an end to that.
Using the BSD license on codeplex would grant the same rights as the CPOL.
Thanks
|
|
|
|

|
I am creating a multi threaded application that need some temprorary data store. I tried sqllite and failed. thinking to try Raptor. Is there is any example for multithread application
Thanks
Albert
Have a date for free
|
|
|
|

|
Hello,
First let me say thank you for creating this tool, it is truly great. I have a view with a boolean field that I would like to filter on. However attempting to query for all records where this field is "true" returns 0 rows, querying for value "false" returns all of the records. If this feature is not yet implemented that's fine, however if it should work please let me know and I'll post more code.
Here is my Query:
var q = rap.Query(typeof(ImageFile), (ImageFile i) => i.FileUpdated == false);
Thanks!
|
|
|
|

|
hi,
you provide to download raptor db doc version 1.8.3 but source code version is 1.0. so where is the raptor db source code version 1.8.3. provide link to download raptor db source code version 1.8.3 if possible.
tbhattacharjee
|
|
|
|

|
I have added an Enum to my entity and the related views and i now get an exception registering the views. Raptor.Entities.Languages is the Enum. i will post classes below the exception
System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=GenericArguments[0], 'Raptor.Entities.Languages', on 'RaptorDB.TypeIndexes`1[T]' violates the constraint of type 'T'.
Source=mscorlib
StackTrace:
at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
at RaptorDB.Views.ViewHandler.CreateIndex(String name, Type type) in D:\AnimeManager\Libs\RaptorDB\RaptorDB doc v1.8.3\RaptorDB\Views\ViewHandler.cs:line 591
at RaptorDB.Views.ViewHandler.CreateLoadIndexes(ViewRowDefinition viewRowDefinition) in D:\AnimeManager\Libs\RaptorDB\RaptorDB doc v1.8.3\RaptorDB\Views\ViewHandler.cs:line 486
at RaptorDB.Views.ViewHandler.SetView[T](View`1 view, KeyStoreGuid docs) in D:\AnimeManager\Libs\RaptorDB\RaptorDB doc v1.8.3\RaptorDB\Views\ViewHandler.cs:line 91
at RaptorDB.Views.ViewManager.RegisterView[T](View`1 view) in D:\AnimeManager\Libs\RaptorDB\RaptorDB doc v1.8.3\RaptorDB\Views\ViewManager.cs:line 246
at RaptorDB.RaptorDB.RegisterView[T](View`1 view) in D:\AnimeManager\Libs\RaptorDB\RaptorDB doc v1.8.3\RaptorDB\RaptorDB.cs:line 245
at Raptor.Data.OpenDB() in d:\AnimeManager\AnimeManager\DataLayer\Raptor\Data.cs:line 45
at UnitTests.DataLayerRaptorTests.TestInitialize() in d:\AnimeManager\AnimeManager\UnitTests\DataLayerRaptorTests.cs:line 30
InnerException: System.TypeLoadException
HResult=-2146233054
Message=GenericArguments[0], 'Raptor.Entities.Languages', on 'RaptorDB.MGIndex`1[T]' violates the constraint of type parameter 'T'.
Source=mscorlib
TypeName=""
StackTrace:
at System.RuntimeTypeHandle.Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, Int32 numGenericArgs, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.Instantiate(Type[] inst)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
InnerException:
public class NameList : EntityBase
{
public List<Name> Names { get; set; }
public List<DataSourceDetail> DataSourceDetails { get; set; }
public NameList()
: base()
{
Names = new List<Name>();
DataSourceDetails = new List<DataSourceDetail>();
}
}
[RegisterView]
public class NameListView : View<NameList>
{
public class RowSchema : RowSchemaBase {
public Guid UnquieID;
public Languages Language;
public NameTypes NameType;
[FullText]
public string Name;
public override Type GetViewType()
{
return typeof(NameListView);
}
}
public NameListView()
{
this.Name = "NameList";
this.Description = "A primary view for NameList";
this.isPrimaryList = true;
this.isActive = true;
this.BackgroundIndexing = false;
this.Version = 1;
this.Schema = typeof(NameListView.RowSchema);
this.AddFireOnTypes(typeof(NameList));
this.Mapper = (api, docid, doc) =>
{
foreach (var name in doc.Names)
{
api.Emit(docid, doc.UniqueID, name.Language, name.NameType, name.Value);
}
};
}
}
|
|
|
|

|
So I'm deleting objects from the database using
DB.Delete(docid);
Then if for some reason I have to force the views to rebuild by deleting the "Views" folder under that RaptorDB data folder the deleted entries reappear in my view again.
Now we get strange behaviour
DB.Delete(docid);
returns false but still removes the entry from the view. But a call to
DB.Fetch(docid);
returns null, so although we can see the deleted entries in the view we can't actually retrieve the object they represent.
You mention in the documentation that the objects are never actually deleted, they are just flagged as deleted but it looks to me that there is a bug with this here when views are being rebuilt.
I've tried to have a look at the code around this but haven't quite been able to figure out how this flagging is being done yet.
Thanks in advance for the help.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
NoSql, JSON based, Document store database with compiled .net map functions and automatic hybrid bitmap indexing and LINQ query filters (now with standalone Server mode, Backup and Active Restore, Transactions, Server side queries, MonoDroid support)
| Type | Article |
| Licence | CPOL |
| First Posted | 29 Apr 2012 |
| Views | 168,524 |
| Downloads | 5,475 |
| Bookmarked | 243 times |
|
|