Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Opening databases fails, erratic behaviour

Help
Toby Irmer
2010-04-05
2013-04-14
  • Toby Irmer
    Toby Irmer
    2010-04-05

    Hi there,

    I have been using Karatasi for a while now, and I really appreciate the work you guys have put into this project. It works very well and has helped me a lot.

    Now that there is a windows version of the application for managing one's databases, I thought I would give that a try. Unfortunately, I have been running into some problems. I have one databases on my iphone, named "Türkisch". When I import that db to my windows machine, the import goes just fine. I cannot, however, do anything with the import. Whenever I close and reopen the application in windows, there is more than one database, with the u-umlaut not being displayed correctly.  Could it be that UTF-8 is not supported? The umlaut ends up being encode as TÃÃ, and also it is multiplied everytime I reopen the program. Or rather, another db is shown, with an ever increasing number of wrongly encoded umlauts.

    Needless to say that I cannot do anything with the database, as it will not open correctly. I have enclosed some screenshots and error logs.

    Let me know I you need any further details on this. I hope you keep up the good work :)

    I am running Windows x64 Professional and Java version 1.6.0_19
    Java(TM) SE Runtime Environment (build 1.6.0_19-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 16.2-b04, mixed mode)

    Here are some error logs:

    05.04.2010 13:07:01 net.sf.karatasi.desktop.DatabaseListController doDatabaseView
    WARNUNG: Open of database Türkischfailed
    java.sql.SQLException: no such table: category
    at org.sqlite.DB.throwex(DB.java:288)
    at org.sqlite.NestedDB.prepare(NestedDB.java:115)
    at org.sqlite.DB.prepare(DB.java:114)
    at org.sqlite.Stmt.executeQuery(Stmt.java:89)
    at net.sf.karatasi.database.Database.countCategories(Database.java:1023)
    at net.sf.karatasi.desktop.CardsTableModel.<init>(CardsTableModel.java:74)
    at net.sf.karatasi.desktop.DatabaseViewPanel.<init>(DatabaseViewPanel.java:87)
    at net.sf.karatasi.desktop.DatabaseViewController.<init>(DatabaseViewController.java:53)
    at net.sf.karatasi.desktop.DatabaseListController.doDatabaseView(DatabaseListController.java:307)
    at net.sf.karatasi.desktop.GuiMain.viewDatabase(GuiMain.java:402)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.sf.japi.swing.action.ReflectionAction.actionPerformed(ReflectionAction.java:174)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)



     
  • Christa Runge
    Christa Runge
    2010-04-05

    Hi Toby,

    I tried to reproduce the strange behaviour as you reported but in vain. I need more details what exactly you tried to do with the program.

    1) Do I understand correctly that you created the database on the iPhone, and then transmitted it with success to the Java program, before it started to behave strangely?
    2) Did you then just try to open it, or was some kind of 'import' function involved (for example import from *.csv encoded data)?

    Regards,

    Christa

     
  • Toby Irmer
    Toby Irmer
    2010-04-06

    Hi Christa,

    I tried opening it, but that did not work. I have now uploaded the DB in question. Maybe that will help you reproduce the error?

    http://drop.io/s9iftuf/asset/t-rkisch-kdb

    Kind regards,
    Toby

     
  • Christa Runge
    Christa Runge
    2010-04-07

    Hi Toby,

    I have received your Türkisch database, the database itself is fine.
    It seems that the umlaut in the name leeds to problems on some operating systems / file systems; we are planning a bugfix for this. (By the way: do you know which kind of file system your Windows is using?)

    Meanwhile you can do the following test to verify that it is indeed only the name:
    - on the iPhone, copy your database
    - then rename the copy to a different name without umlaut
    - transmit this copy also to the PC, and try to open it.

    The menu to perform the copy is a bit hidden:
    in the file list, press the upper right button (organize), then select the database, and use the 'copy' icon in the toolbar.
    see http://karatasi.sourceforge.net/manual/en/db_table_view.html
    http://karatasi.sourceforge.net/manual/en/db_table_view_edit.html
    http://karatasi.sourceforge.net/manual/en/db_edit_view.html

    Regards,

    Christa

     
  • Christa Runge
    Christa Runge
    2010-04-09

    Hi Toby,

    up to now I could not reproduce the erratic behavior as you describe it, but now I have a suspicion.
    Could you please look up the file encoding of your system?

    Use the karatasi menu: Help / About / Runtime Properties;
    then you see a line like

    file.encoding=UTF-8

    Currently I suspect that your Windows 64 bit professional uses a different encoding, but I would like to verify this assumption.

    Regards,

     
  • Toby Irmer
    Toby Irmer
    2010-04-09

    Christa,

    Yes, indeed. That seems to be the case:

    file.encoding=Cp1252

    I think that is a Microsoft flavour of Latin1. I just don't know why they would use that in the year 2010. :D

    And renaming the database solved the problem for me. I had actually tried to do that, but couldn't find out how to do it. But with your directions it worked like a charm. Thank you very much.

    Kind regards
    Toby

     
  • Christa Runge
    Christa Runge
    2010-04-12

    Hi Toby,

    although we can still not reproduce the behaviour as you saw it with your "Türkisch" database, your detailed error description together with your screenshots and error logs give us a quite clear picture what was going on. It seems that the File API and the database API disagree on the encoding of the filenames; so the database API cannot find the existing database file, and creates a new one instead. This might be a bug in the database library which we are using.

    Anyhow, filenames with umlauts call for trouble. Therefore we have revised our strategy for filenames for the karatasi databases and use now plain ASCII names. We have just released this version 0.2.1, which fixes also several other issues.

    We are really interested to hear if database names with umlauts and non-ASCII characters like "Türkisch" are now better supported.

    If it is not too much work for you - would you please be so kind and try it again?

    Thanks a lot.

    Christa