|
|
Comments and Discussions
|
|
 |
|
|

|
query for bool was not working in server mode using a LINQ query (string query worked), found bug on line 148 of LINQString.cs:
changed:
sb.Append(((bool)c.Value) ? 1 : 0);
to
sb.Append(((bool)c.Value) ? "True" : "False");
|
|
|
|
|
|
|

|
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:30.
|
|
|
|

|
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:25.
|
|
|
|

|
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.
|
|
|
|

|
Hi,
Just wondering is there any way the Count and Query methods could be made more like typical Linq methods like
int count = rap.Count<SalesInvoice>();
int count = rap.Count<SalesInvoice>(x=>x.Status == 1);
instead of
int count = rap.Count(typeof(SalesInvoice);
int count = rap.Count(typeof(SalesInvoice), (SalesInvoice si)=>(si.Status == 1);
It would also be great if you could do a similar thing with a query an get a typed result set back of the type you queried.
Also it would be nice to be able to do something similar for the load where the result is typed or null.
I have only just started to play with this DB and apart from finding the query syntax a little strange and getting me head around views where the data is a sub object of the view i am really loving it.
also in case it is helpful i use this wrapper for you count function
public int Count<T>()
{
if (rap != null)
{
return rap.Count(typeof(T));
}
return 0;
}
|
|
|
|

|
Great data base lib only thing missing is that it is not on nuget yet. Hopefully the author adds it soon.
Article is great and so is the software. Almost impossible to find that.
|
|
|
|

|
Hi,
I've an app that pulls a number of objects from RaporDB then allows the user to edit 1 of the properties of these objects and then writes the changes back to RaptorDB again. I'm getting some strange behavior where occasionally objects will get duplicated when I save them...instead of overwriting the original object. The app is a WPF app, using a DataGrid for the editing.
I'm displaying the list of views returned for a query against RaptorDB in the DataGrid. Then when the user edits one of these objects I'm fetching the original object, updating it with the changed value. Lastly I save this object back to the DB. Most of the time this is working but about 30% of the time (as a rough estimate) I'm ending up with a duplicate object with the same docid but with the old value of the updated property. Any idea on what I'm doing wrong here?
A simplified version of the code is here:
My objects that are stored in RaptorDB
public class Sample
{
public Guid ID;
public string Name;
public string FieldTwo;
public ScanContainer()
{
ID = Guid.NewGuid();
Name = "Sample Name";
FieldTwo = DateTime.Now.ToString("o");
}
}
public class SampleView : View<Sample>
{
public class RowSchema : RDBSchema
{
public string Name;
public string FieldTwo;
}
public SampleView()
{
this.Name = "Sample";
this.Description = "A primary view for Samples";
this.isPrimaryList = true;
this.isActive = true;
this.BackgroundIndexing = true;
this.Schema = typeof(SampleView.RowSchema);
this.AddFireOnTypes(typeof(Sample));
this.Mapper = (api, docid, doc) =>
{
api.EmitObject(docid, doc);
};
}
}
Some DB code
public static class DBHelper
{
public static RaptorDB.RaptorDB DB = RaptorDB.RaptorDB.Open("_data");
public static void Close()
{
DB.Shutdown();
}
public static object FetchDocument(object ViewRowSchema)
{
Guid objectId = ((RDBSchema)ViewRowSchema).docid;
if(objectId != Guid.Empty && objectId != null)
{
return DB.Fetch(objectId);
}
else
return null;
}
public static List<object> GetList()
{
DB.RegisterView(new SampleView());
List<object> result = DB.Query(typeof(Sample)).Rows;
return result;
}
public static bool SaveSampleListNameChange(object SampleViewRowSchema, string newValue)
{
DB.RegisterView(new SampleView());
Sample toUpdate =(Sample) FetchDocument(SampleViewRowSchema);
if(toUpdate != null)
{
toUpdate.Name = newValue;
return DB.Save(toUpdate.ID, toUpdate);
}
else
return false;
}
}
The XAML code for my data grid
<DataGrid Name="sampleList_DataGrid"
ItemsSource="{Binding}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CellEditEnding="DataGrid_CellEditEnding">
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Name}"
Width="*"
Header="Name"/>
<DataGridTextColumn
Header="Field Two"
Binding="{Binding FieldTwo}"
Width="*"
IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
The C# code behind the datagrid.
void PopulateDatagrid()
{
sampleList_DataGrid.ItemsSource = DBHelper.GetSampleList();
}
void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if(e.EditAction == DataGridEditAction.Commit)
{
TextBox textBox = e.EditingElement as TextBox;
if(!string.IsNullOrWhiteSpace(textBox.Text))
{
if(!DBHelper.SaveSampleListNameChange(e.Row.Item, textBox.Text))
MessageBox.Show("Unable to save edit");
}
}
}
|
|
|
|

|
Hi Mehdi,
How can I discard deleted objects ?
ES ( where userId is a string ):
Models.User usr = (Models.User)raptorDB.Fetch(new Guid(userId));
raptorDB.delete(usr.ID);
var qry = raptorDB.Query(typeof(Models.User));
Most probably I did not understand how deletion work.
Thanks in advance
|
|
|
|

|
I was wondering if Dynamic objects are supported at all. I currently use them a lot as a way to let plugins add more data to my main objects or add new objects without having to change my core code/libraries. Basically at start-up i load a config that applies strict rules on my Dynamic objects and the properties and data types of each field as well as specifies if they are used for searching etc.
I am guessing i would need to change that design to make it work with your database and maybe look at some auto generated classes that then get compiled or something so that i have the data class and the required views for your database. Is there anyway it could all be done from code instead?
|
|
|
|

|
Hi,
First thanks for this great project. I've only started looking at it recently but I like what I see so far.
I was having issues retrieving a particular type of object from the db with the following stack trace
System.NullReferenceException: Object reference not set to an instance of an object.
at fastBinaryJSON.BJSON.CreateGenericList(List`1 data, Type pt, Type bt, Dictionary`2 globalTypes) in v1.8.3\RaptorDB.Common\fastBinaryJSON\BJSON.cs:line 508
at fastBinaryJSON.BJSON.ParseDictionary(Dictionary`2 d, Dictionary`2 globaltypes, Type type, Object input) in v1.8.3\RaptorDB.Common\fastBinaryJSON\BJSON.cs:line 426
at fastBinaryJSON.BJSON.ParseDictionary(Dictionary`2 d, Dictionary`2 globaltypes, Type type, Object input) in v1.8.3\RaptorDB.Common\fastBinaryJSON\BJSON.cs:line 453
at fastBinaryJSON.BJSON.ToObject(Byte[] json, Type type) in v1.8.3\RaptorDB.Common\fastBinaryJSON\BJSON.cs:line 171
at fastBinaryJSON.BJSON.ToObject(Byte[] json) in v1.8.3\RaptorDB.Common\fastBinaryJSON\BJSON.cs:line 149
at RaptorDB.RaptorDB.CreateObject(Byte[] b) in v1.8.3\RaptorDB\RaptorDB.cs:line 464
at RaptorDB.RaptorDB.Fetch(Guid docID) in v1.8.3\RaptorDB\RaptorDB.cs:line 219
After a bit of investigation in appears that it is because the object that I'm retrieving has a property with a public getter and a private setter. Changing this private setter back to being public fixed this issue but I'm trying to see if there is a better way of doing this? I'd prefer to not have to make this setter public.
Some sample code to show the structure of my object. In reality my code is a lot more complicated and the getter has a lot more logic in it so it's not possible to have the setter actually set the value of "property2".
public class Sample
{
public string property1;
private string _property2;
public string property2
{
get
{
return _property2;
}
private set
{
}
}
public Sample(string initProp)
{
_property2 = prop;
}
}
I get the error with the code above when I try to retrieve an object of type Sample. If I change the line "private set" to "set" then I can retrieve objects of type sample.
Thanks in advance for the help.
|
|
|
|

|
What are the chances a shared hosting provider is going to have this?
-MickeyB
|
|
|
|
|

|
Mehdi, Thanks for update 1.83. Is it possible to use the FullText attribute with a string field that consists of a single word? I get an IndexOutOfRange exception when I try to do so. For example, can a search of a forename field using Jo* return John, Joe etc?
|
|
|
|

|
Hi Mehdi.
I do not want to bore you. Sorry.
One of the most common operation using a storage system is to count objects/records that meet certain criteria or more simply to get a total count of objects present.
Your StorageFile's performances are very impressive but obviously deserializing object it's time and resources consuming.
In order to get a simple count of a very large set of object ViewHandler.Query method still creates a full populed list of objects. To get a count of milions object store could be very slow, could consume a very great qty of memory and only to get a simply "2,000,000 of record are presents" message.
If I can I'd like to submit to you a possible solution to lazyload data mantaining a fully backward compatible interface for the clients.
Obviously this is only one of the possible solutions ad a bit of additional work has to be done in order to be sure to make consistent the ViewHandler object state since data are loaded from the client.
The solution consist of a new class to be able to define a typed lazyload object (In this case I preferred to non use the System.Lazy class in order to have the complete control for implicit casting):
public class LazyLoader<T>
{
T value;
Func<T> loader;
public LazyLoader(T value) { this.value = value; }
public LazyLoader(Func<T> loader) { this.loader = loader; }
T Value
{
get
{
if (loader != null)
{
value = loader();
loader = null;
}
return value;
}
}
public static implicit operator T(LazyLoader<T> lazy)
{
return lazy.Value;
}
public static implicit operator LazyLoader<T>(T value)
{
return new LazyLoader<T>(value);
}
}
Result class changed as below
public class Result
{
private LazyLoader<List<object>> lazyRows = null;
public Result()
{
}
public Result(bool ok)
{
OK = ok;
}
public Result(bool ok, Exception ex)
{
OK = ok;
EX = ex;
}
/// <summary>
/// T=Values return, F=exceptions occurred
/// </summary>
public bool OK { get; set; }
public Exception EX { get; set; }
/// <summary>
/// Total number of rows of the query
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// Rows returned
/// </summary>
public int Count { get; set; }
public void SetLazyRows(LazyLoader<List<object>>
lazyResultRows)
{
this.lazyRows = lazyResultRows;
}
public List<object> Rows
{
get
{
return lazyRows;
}
set
{
this.lazyRows = new LazyLoader<List<object>> (value);
}
}
// FEATURE : data pending in results
///// <summary>
///// Data is being indexed, so results will not reflect
all documents
///// </summary>
//public bool DataPending { get; set; }
}
Some changes in Query e ReturnRows methods of ViewHandler class and a new Global variable to indicate if to use or not lazy loading... It's a bit frustrating to write code using this editor so if you 'd like to discuss about the matter we can choose an'other way to comunicate.
Thanks for your attention
Antonello
|
|
|
|

|
Inserting a large amount of data RabptorDB.FileLogger.Log method returns an "Source array was not long enough".
This could be caused by a bad access to to the _que member. To enque data in Queue the usafe code Array.Copy is used. in case of concurrent access from multiple threads to _que it's possible to get that kind of exception.
A possible solution could consist of lock the _que member directly instead of using different objects (_lock, _writelock) to syncronize access.
Below one possible solution to apply to FileLogger class methods involved.
Obviously it has to be evalued as valid.
public void Log(string logtype, string type, string meth, string msg, params object[] objs)
{
lock(_que) _que.Enqueue(FormatLog(logtype, type, meth, msg, objs));
}
private void WriteData()
{
if (_output == null)
return;
lock(_que) {
..
..
..
..
}
}
|
|
|
|

|
When Adding a new View on existing data or in order to rebuild index deleting the "view" folder ViewManager.RebuildFromScratch method is invoked.
MethodInfo view is never setted cause the bad BindingFlag used. "Insert" is marked as internal so BindingFlags.NonPublic must be added in order to get it.
Old statement in RebuildFromScratch method:
view = this.GetType().GetMethod("Insert", BindingFlags.Instance | BindingFlags.Public );
should be:
view = this.GetType().GetMethod("Insert", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
modified 18 Sep '12 - 10:06.
|
|
|
|

|
First of all. Great Work!!!
I'm experimenting RaptorDB but it seems to have some trouble using double type.
Storing a class containing double property i get an Null reference exception during page save process (IndexFile::SavePage) when I shutdown the engine.
"Double" type is not handled ( no corresponding handler is returned by RDBDataType.ByteHandler().Is there some reason ?
foreach (var kp in keys)
{
var val = node.tree[kp];
int idx = index + _rowSize * i++;
byte[] kk = _T.GetBytes(kp);
byte size = (byte)kk.Length;
if (size > _maxKeySize)
size = _maxKeySize;
My simple class :
public class BaseStore
{
public Guid UNIQUEID { get; private set; }
public BaseStore()
{
UNIQUEID = Guid.NewGuid();
}
}
public class TestClass : BaseStore
{
public int id { get; set; }
public String Description { get; set; }
public int intero { get; set; }
public decimal decimale { get; set; }
public float floating { get; set; }
public long lungo { get; set; }
public double doppio { get; set; }
}
[RegisterView]
public class TestClassView : RaptorDB.View<TestClass>
{
public class RowSchema : RaptorDB.RDBSchema
{
public int id { get; set; }
public String Description { get; set; }
public decimal decimale { get; set; }
public double doppio { get; set; }
}
public TestClassView()
{
this.Name = "TestClass";
this.Schema = typeof(RowSchema);
this.isActive = true;
this.isPrimaryList = true;
this.AddFireOnTypes(typeof(TestClass));
this.Mapper = (api, docid, doc) => { api.Emit(docid,doc.id, doc.Description,doc.decimale,doc.doppio); };
}
}
Any Idea ?
Best Regards
Thanks in advance
Antonello
modified 18 Sep '12 - 5:24.
|
|
|
|

|
Hi,
How does RaptorDB compare to RavenDB?
(sorry if the question has been asked before)
Thanks
John
|
|
|
|

|
Mehdi, thanks for your help. In your example application, it would appear that the Class LineItem must have a default constructor. Changing the class definition to initialise its properties by way of arguments in the constructor seems to give rise to a null reference exception when inserting data in server mode. Is this correct? Regards, George.
|
|
|
|

|
I am working in NLP, have similar engineering background than you, once programmed 65xx (Rockwell/Commodore) µP, also did a lot of Pascal (USCD) Delphi, wrote some Database myself (non-sql in Pascal) on the '80s
The fast indexing Bit-mechanism might be used to implement a simple (but fast) RDF storage system (triplets) and implementing some sort of super-fast queries like SPARQL, to make good reasoning systems. Backchaining and Formward chaining algorithms suffer from database access time, and here the thing might be solved in a glimpse!
If you want, check my website (sorry in Spanish) but some Articles are in plain english! and Goggle Translate is very good to take a look to my ideas adn work, mighjt be interested by curiosity!
My Personal Page is there[^]
best!
|
|
|
|

|
Hi,
I created a database of 100,000 records, then I tried to insert other 100,000 records, but I got an error after some seconds. Please help!
Thanks a lot
p/s: Here's the stacktrace
System.AggregateException was unhandled
Message=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.TaskExceptionHolder.Finalize()
InnerException: System.ArgumentNullException
Message=Value cannot be null.
Parameter name: key
Source=System
ParamName=key
StackTrace:
at System.Collections.Generic.SortedList`2.IndexOfKey(TKey key)
at System.Collections.Generic.SortedList`2.Remove(TKey key)
at RaptorDB.Common.SafeSortedList`2.Remove(T key) in D:\raptordb-8cae451eb90e\RaptorDB.Common\SafeDictionary.cs:line 104
at RaptorDB.MGIndex`1.SplitPage(Page`1 page) in D:\raptordb-8cae451eb90e\RaptorDB\Indexes\MGIndex.cs:line 385
at RaptorDB.MGIndex`1.Set(T key, Int32 val) in D:\raptordb-8cae451eb90e\RaptorDB\Indexes\MGIndex.cs:line 159
at RaptorDB.TypeIndexes`1.Set(Object key, Int32 recnum) in D:\raptordb-8cae451eb90e\RaptorDB\Indexes\Indexes.cs:line 23
at RaptorDB.Views.ViewHandler.IndexRow(Guid docid, Object[] row, Int32 rownum) in D:\raptordb-8cae451eb90e\RaptorDB\Views\ViewHandler.cs:line 549
at RaptorDB.Views.ViewHandler.InsertRowsWithIndexUpdate(Guid guid, List`1 rows) in D:\raptordb-8cae451eb90e\RaptorDB\Views\ViewHandler.cs:line 513
at RaptorDB.Views.ViewHandler.SaveAndIndex(Dictionary`2 rows) in D:\raptordb-8cae451eb90e\RaptorDB\Views\ViewHandler.cs:line 149
at RaptorDB.Views.ViewHandler.Insert[T](Guid guid, T doc) in D:\raptordb-8cae451eb90e\RaptorDB\Views\ViewHandler.cs:line 141
at RaptorDB.Views.ViewManager.<>c__DisplayClass2`1.b__0() in D:\raptordb-8cae451eb90e\RaptorDB\Views\ViewManager.cs:line 126
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
|
|
|
|

|
Thanks for the interesting article.When running in Server Mode, I get the following exception when adding items in the sample application
System.InvalidCastException: Unable to cast object of type 'SampleViews.SalesInvoice' to type 'System.Object[]'.RaptorDBServer.cs:line 92. Best wishes.
|
|
|
|

|
Well written article 5'd
|
|
|
|

|
Hi!
I was trying to use RaptorDB in a hobby project of mine but I can't figure out how to properly use query filter. It's most likely because Im doin someting wrong
string hash = "0fc78f69a080459b142c31f6ce7637db";
Expression<Predicate<MyTable>> qFilter = ( MyTable s ) => (s.hash == "0fc78f69a080459b142c31f6ce7637db");
Expression<Predicate<MyTable>> qFilterParam = ( MyTable s ) => (s.hash == hash);
var q1 = rdb.Query ( typeof ( MyTableView ),(MyTable s) => (s.hash == "0fc78f69a080459b142c31f6ce7637db"));
var q2 = rdb.Query ( typeof ( MyTableView ),qFilter);
var q3 = rdb.Query ( typeof ( MyTableView ),qFilterParam);
q1 and q2 both works but as soon as I try to use a variable (hash) the query throws an expection "Specified cast is not valid.".
Any hints on what Im doin wrong ?
Br
Jimmy
|
|
|
|
|
 |
|
|
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 | 156,117 |
| Downloads | 5,171 |
| Bookmarked | 221 times |
|
|