Jump to content
McObject Forums

All Activity

This stream auto-updates     

  1. Last week
  2. Earlier
  3. how to reset correctly

    yes this does the trick, iterator.remove thanks
  4. My delete does not work

  5. My delete does not work

    1. You should exclude objects from index(es) prior to deallocation it. I do not think that it will really cause a problem in your case, but in any case it is reasonable to exclude objects from indexes before deallocating them. 2. Deallocation of objects is done in many Perst examples. You can look at TestAlloc.java, for example. 3. It is not clear from your code what is the original size of the database and how many objects are actually deleted by deleteFahrt. If it deletes just a few objects that have a total size of less than one page, then the size of database after compactification could be the same as the original database.
  6. My delete does not work

    Hello, I changed my code and add deallocate for each object. But after that the used storage size is the same like before. I will attach my new Code to this post. Can you write me some example code how to completly delete single objects(with deallocation and so on)? Perst delete Fahrt.txt
  7. My delete does not work

    Excluding objects from index doesn't cause deallocation of object instances themselves. You must explicitly call Deallocate() method for each object or use ITable.DeallocateMembers method.
  8. My delete does not work

    Hello, I changed my code for delete and added a db.commit. But this changes nothing. The needed Space is the same like before delete. I will attach my new code to this post. Perst delete code example.txt
  9. My delete does not work

    You need to commit the current transaction to persist your changes and make them visible in backup.
  10. My delete does not work

    yes. This happens in line 27 - 30 of my code Perst delete Fahrt.txt.
  11. My delete does not work

    After the backup, did you delete the original database file and rename the backup to the name of the original file?
  12. My delete does not work

    Inside this code I delete the data and made a backup. You said after delete all data and making a backup the internal storage gets free. But this is not working. After delete and backup the size needed from internal storage is the same size like before delete.
  13. Query 3+ values against one index

    Yes, of course.
  14. My delete does not work

    What are we looking for in your code?
  15. My delete does not work

    I will attach the used code as file to this post. Perst delete Fahrt.txt
  16. Query 3+ values against one index

    This worked great, thanks for the quick response! Will this be added to the latest Perst source code for the general public?
  17. My delete does not work

    No, you should perform backup to some other file and then you can rename it to original file.
  18. My delete does not work

    Can I use the same filepath which I use for the database or do I have to use a second file for backup?
  19. My delete does not work

    It is Storage.backup method: /** * Backup current state of database * @param out output stream to which backup is done */ public void backup(java.io.OutputStream out) throws java.io.IOException; /** * Backup current state of database to the file with specified path * @param filePath path to the backup file * @param cipherKey cipher key for the encryption oof the backup file, null to disable encryption */ public void backup(String filePath, String cipherKey) throws java.io.IOException; It performs backup of the storage file and defragment it at the same time.
  20. Query 3+ values against one index

    Apply the following patch to database.cs, rebuild Perst, and it should fix the problem: Index: src/Database.cs =================================================================== --- src/Database.cs (revision 15853) +++ src/Database.cs (working copy) @@ -1827,23 +1827,23 @@ } if (expr.NodeType == ExpressionType.OrElse) { - if (left.NodeType == ExpressionType.Equal && IsLiteral(((BinaryExpression)left).Right, out value)) + if (right.NodeType == ExpressionType.Equal && IsLiteral(((BinaryExpression)right).Right, out value)) { - Expression baseExpr = ((BinaryExpression)left).Left; + Expression baseExpr = ((BinaryExpression)right).Left; alternatives = new ArrayList(); - while (right is BinaryExpression) + while (left is BinaryExpression) { Expression cmp; - if (right.NodeType == ExpressionType.OrElse) + if (left.NodeType == ExpressionType.OrElse) { - BinaryExpression or = (BinaryExpression)right; - right = or.Right; - cmp = or.Left; + BinaryExpression or = (BinaryExpression)left; + left = or.Left; + cmp = or.Right; } else { - cmp = right; - right = null; + cmp = left; + left = null; } if (cmp.NodeType != ExpressionType.Equal || !EqualExpressions(baseExpr, ((BinaryExpression)cmp).Left) @@ -1853,11 +1853,11 @@ } alternatives.Add(value); } - if (right != null) + if (left != null) { return null; } - expr = left; + expr = right; left = ((BinaryExpression)expr).Left; right = ((BinaryExpression)expr).Right; }
  21. Query 3+ values against one index

    I've constructed a Perst database that contains several gigs worth of data, all keyed off of date. Occasionally, I have the need to query data across multiple, non-sequential dates using LINQ. Is it currently possible to do this in a way in which the index isn't ignored? So far, I've attempted the following: - Using multiple OR statements - PerstDBTable.Where(a => a.date == date1 || a.date == date2 || a.date == date3); //this only works up to two dates, with 3+ dates the index is ignored and a sequential scan is used. - Using a list and Contains - List<DateTime> dates = new List<DateTime>(); //populate dates here PerstDBTable.Where(a => dates.contains(a.Date)); //This query throws an exception within Perst Please let me know your thoughts. Thank you in advance!
  22. My delete does not work

    Where can I find this Method? I cannot find it with my rootclass or my index. How can I call the compactify method.
  23. My delete does not work

    Perst never shrinks the size of a database. It just marks deallocated objects as free. This space will be reused by new allocation requests. This space is not returned to the file system, so you will not see extra free space after the end of a bulk delete. You can use the compactify method to shrink the database.
  1. Load more activity