Karatsi doesn't work with this databaze

2009-11-25
2013-04-14
  • Vlada Cekal
    Vlada Cekal
    2009-11-25

    Hello, I have problem. I insert records directly to database and I probably did something wrong. Karatasi said that there is 30 records for test but when I click to it, it write "Test finished". can you helo me, please? The database is there http://giga.hu.cz/l_English.zip

    I do it several times … it worked before but for last stop working :-(
    Thank you for help.

    PS: Can you tell me what I have to insert into database when modifiing records directly?

     
  • Christa Runge
    Christa Runge
    2009-12-01

    Hi vlacek,

    I have downloaded your broken database and I observe frequent crashes (after every two or three cards) when I do the test. I do not yet know the reason for the crash but I will debug it in more detail on the weekend.

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-07

    Hello Christa, did you find out what's wrong with my database? It worked without problem before. It stop working after last insert of new words :-(
    King Regards, V.

     
  • Christa Runge
    Christa Runge
    2009-12-09

    Hi Vlacek, so far I could reproduce a scenario which crashes, and I started to debug it. However, I have no final findings yet, only suspicions.
    Technical details: when I query one of your new cards, the query should return a string, but it returns nil, which leads to the crash. I still have to find out what is the reason for the empty query result. Maybe a wrong character encoding? karatasi needs the strings as UTF-8. Please check your encoding.
    Also it might be a bug in karatasi related to non-ASCII characters.

    If you have a tool to manipulate the SQLite database directly, you might try to delete the last records from the database - just as a work-around to get it running again with the old content.

    I will tell you more as soon as I find out.

    Regards,   Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-10

    Dear Christa, thank you very much for your support. 
    Please can you sent me the SQL statement which returns null?
    I am using SQLiteSpy to modify sqlite databases. 
    There really can be problem with wrong unicode - I added a table with pronunciation and some SQLd update cards and automatically add pronunciation. Before that it works fine. I thought I did some mistakes in referential integrity or keys … I didn't think of encoding :-(
    If you sort out my problem, I wil be happy. I have no other ideas …
    Do you have some documentation which describes tables, fields, integrity?

    King regards Vlada

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-10

    Ps: maybe some strings are to long. I have added it directly and I dontt know field size. Only ssort field I cut up to 15 chars.
    V.

     
  • Christa Runge
    Christa Runge
    2009-12-10

    Hi Vlacek,

    1) regarding the documentation of the current karatasi database format: see doc/design/database/DatabaseStructure.txt
    in our subversion repository.

    2) regarding the SQL interface: it is rather not the statement but the API which I am using in the code.
    The crash happens in DBHandler.m ( src/karatasi.iphone/src/Model/ ) around line 173.
    Obj-c does not like when I add a 'nil' element to an array, but this is exactly what happens in your case:
    resultStr has the value nil.

    My current plan is (a) to make the code more robust (use an empty string instead), in order to avoid the crash. (b) try to find out the reason why the API does not return the true content of this field (it might indeed be a buffer overflow, or wrong encoding, or … ).

    Regards,

    Christa

     
  • Christa Runge
    Christa Runge
    2009-12-12

    Hi Vlada,

    I played again with your database and I have now a list of the broken records in the card table. It is the cards with the following id:
    23, 25, 26, 57, 2126, and then 2733 - 2739, 2741 - 2744.
    In all cases it is the pronounciation field which fails.

    I still suspect a wrong encoding - although I have no confirmation for my suspicion, as I did not get a meaningful error code.

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-12

    Thank you very much. It will help me to repair my database. I agree it will be problem with encoding … so when I have a look at them in SqliteSpy it looks correct .. it use UTF-8 I think.

    PS: If you have time please try to buld more robust code which doesn't crash without information what's happen.

    Best regards V.

     
  • Christa Runge
    Christa Runge
    2009-12-13

    Hi Vlada,

    you are absolutely right with your request for more robust code and helpful error messages.
    What we are planning to do is the following:

    (a) implement database integrity checks including check of correct encoding into the Java version. These checks should give detailed error messages. See also our feature tracker #2540510.

    (b) make the iPhone code more robust. For this issue we have setup the bug trackers #2886182 and #2913470.

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-21

    Hi Christa,

    thank you very much for your help and information. I am looking forward to your new robust version due to I am not still able to use my database. I have set all pronunciation field to one space. It doesn't crash now, but when I try to test card, I get message "Test finished" so .. there are still 12 card for test.

    Best Regards Vlada

     
  • Christa Runge
    Christa Runge
    2009-12-22

    Hi Vlada,

    could you please give me the newest version of this database?

    By the way, which karatasi version are you using? You find this information in the 'i' button at the list of databases.

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-22

    Hi Christa, I am using karatasi 1.4.6 10/2009 svn1503 db3. My db file is at http://giga.hu.cz/l_english.zip … this file doesn't contains any cards for test .. no cards added to test after midnight recalculation …
    Probably there can be some problem with dates .. unfortunatelly I am not able find it :-(

    I wish you a Merry Christmas and Happy New Year.
    V.

     
  • Christa Runge
    Christa Runge
    2009-12-23

    Hi Vlacek,

    I have downloaded your database to the simulator and started to test with it. So far I find nothing wrong - I download it to the iPhone, it has 3 categories and 2744 cards, all committed, and 357 cards in test. I can start the test and it shows questions and answers as usual. It does no longer crash, so the encoding seems correct now.
    However, I could reproduce a behavior similar to what you described after I modified the order of the databases in the list and immediately after this opened the database  for test again - I got the message "Test finished" although there were many cards left.
    Do you have more than one database in the list? Did you modify the order?
    In my case it helps simply to finish the test and press again the 'test' button - this time it opens the database correctly.

    What is still strange - you said that you have no card in test, but I see 357.
    I will try tomorrow and load it on the true device instead of the simulator, to see if it behaves different.

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-23

    Hello. I have only one database in list. I have no card in test. When I look at list table, there is no records. I find out I am not able to add record using karatasi. No error is displayed but record not saved.
    It is possible that I add some to database what is not compatible with karatasi?
    When I added cards for test to list table, I have displayed correct number of record but everytime when I press test button I got "test finished"

    merry Christmas and happy new year!
    V.

     
  • Vlada Cekal
    Vlada Cekal
    2009-12-23

    Dear Christa,
    I am very sorry. I sort out the problem with adding records and non working test. When I copy my DB to iPhone, I forget to change owner of file - owner was root and karatasi doesn;t have write access to database file :-((((((((((
    It's working now correctly … THANK YOU!

    Only problem with encoding persist - I have set all records in pronunciation to one space to get the database work. if I set it back, it start crashing without message .. i will lokk forward to future version with robust engine.

    Have a nice day
    V.

     
  • Christa Runge
    Christa Runge
    2009-12-23

    Hi Vlada,

    sorry, but I still cannot reproduce your problems.
    I tried the database which you sent me and it worked well on the simulator as well as on the iPhone.
    Maybe the database transmission does not work correctly?

    Please do the following: transmit the database back from the iPhone to your PC and send me *this file* for analysis.

    Which transmission mechanism are you using - the cgi scripts, or the Java application?

    Do you have Internet relay chat?
    If yes, you can visit us now at  #karatasi at irc.freenode.net  .
    We are online, and the chat might be a faster communication than the forum.

    Regards,

    Christa

     
  • Christa Runge
    Christa Runge
    2009-12-23

    Hi Vlada,

    don't worry, that happens to everybody at least once …

    ;-)))

    We are glad that it works now - have fun!!!

    We wish you also a merry christmas, and a happy new year!

    Christa

     
  • Christa Runge
    Christa Runge
    2009-12-23

    Hi Vlada,

    regarding the encoding: I have still the suspicion that your SQL tool does an encoding which is not UTF-8.
    I have no indication for a buffer overflow, and the pronounciation field is not extremely large.

    The next version of karatasi will still need UTF-8 encoded data. If the data is not UTF-8 encoded it will show an empty field, just not crash.

    Do you have a tool to show a hex dump of the output of your SQL Spy?

    Regards,

    Christa

     
  • Vlada Cekal
    Vlada Cekal
    2010-01-04

    Hello Christa, unfortunatelly I am not able to send you a hex dump of the output of my SQLSpy (http://www.geardownload.com/business/sqlitespy.html).  You have my database I think you can do the hex dump using your favorite tool.

    Thank you very much for your support
    Best regards Vlada

     
  • Christa Runge
    Christa Runge
    2010-01-04

    Hi Vlada,

    no problem, I have your database, and my debugger shows me that some fields are indeed not UTF-8 encoded.
    In the next version the iPhone will show such fields as blank.

    Regards,

    Christa