{ "id": "82488", "key": "TIMOB-6081", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "12093", "description": "", "name": "Sprint 2012-01", "archived": true, "released": true, "releaseDate": "2012-01-15" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-31T15:53:52.000+0000", "created": "2011-11-08T11:06:00.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "qe-testadded" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-01-31T15:53:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3.Problem\r\nWhile using the Titanium.Database.install on the simulator it is supposed to copy the database file to the /database directory under the application root folder, however it makes only a symbolic link between the file that is under /database and the one that was in /Resources.\r\n\r\nThe issue appears only on Simulator.\r\n\r\nh3.Reproducible Steps\r\n1. Run the sample code with the sample database (db file attached)\r\n2. Go to the application folder under simulator, the path should look similar: /Users/dawconsdwitservices/Library/Application Support/iPhone Simulator/5.0/Applications/D30F4B39-8A41-4B7F-A271-4EAF69AFDFC9/Library/Application Support/database . Take a look that the myDB.db file which is only a link to the original database file that is under /Resources folder.\r\n\r\nh3.Sample Code\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nvar db = Titanium.Database.install('speed.db','myDB');\r\n\r\nwin1.add(label1);\r\nwin1.open();\r\n\r\n{code}\r\n\r\nh3.Associated HelpDesk Ticket\r\nhttp://appc.me/c/APP-421442", "attachment": [ { "id": "24090", "filename": "database.png", "author": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-08T11:06:00.000+0000", "size": 254914, "mimeType": "image/png" }, { "id": "24089", "filename": "speed.db", "author": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-08T11:06:00.000+0000", "size": 1802240, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: Database.install does not copy the database file only creates a symbolic link", "creator": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kpomaski", "key": "kpomaski", "displayName": "Karol Pomaski", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Simulator, iOS5, SDK 1.7.5, 1.8.0.v20111106143455", "comment": { "comments": [ { "id": "173124", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This is expected behavior on the simulator. Works properly on device.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-11-17T10:34:55.000+0000", "updated": "2011-11-17T10:34:55.000+0000" }, { "id": "173126", "author": { "name": "dae", "key": "dae", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The new behaviour is quite inconvenient - as I described in the helpdesk ticket, every time I test in the simulator, the pristine database is modified. It may be \"expected\" in that you guys decided to change the behaviour, but as a user of the toolkit it is not the behaviour I expect - especially as it's inconsistent with installing on a device. Please reconsider.", "updateAuthor": { "name": "dae", "key": "dae", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-17T10:43:46.000+0000", "updated": "2011-11-17T10:43:46.000+0000" }, { "id": "173220", "author": { "name": "dae", "key": "dae", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I presume your comment was directed at Vishal - if not, please let me know.", "updateAuthor": { "name": "dae", "key": "dae", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-17T19:20:01.000+0000", "updated": "2011-11-17T19:20:01.000+0000" }, { "id": "175614", "author": { "name": "ben.bahrenburg@gmail.com", "key": "ben.bahrenburg@gmail.com", "displayName": "Ben Bahrenburg", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also running into issues with this. See helpdesk ticket http://support.appcelerator.com/tickets/APP-825542/tickets for details.", "updateAuthor": { "name": "ben.bahrenburg@gmail.com", "key": "ben.bahrenburg@gmail.com", "displayName": "Ben Bahrenburg", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-09T15:31:11.000+0000", "updated": "2011-12-09T15:31:11.000+0000" }, { "id": "178455", "author": { "name": "nick@nicksavvides.com", "key": "nick@nicksavvides.com", "displayName": "Nick", "active": true, "timeZone": "Australia/Sydney" }, "body": "I pleased to see this reopened because this is definitely not expected or desired behaviour. It breaks development, it breaks testing and makes a mess of your database. I am keen to see this resolved.", "updateAuthor": { "name": "nick@nicksavvides.com", "key": "nick@nicksavvides.com", "displayName": "Nick", "active": true, "timeZone": "Australia/Sydney" }, "created": "2012-01-07T16:49:40.000+0000", "updated": "2012-01-07T16:49:40.000+0000" }, { "id": "178456", "author": { "name": "nick@nicksavvides.com", "key": "nick@nicksavvides.com", "displayName": "Nick", "active": true, "timeZone": "Australia/Sydney" }, "body": "So I've read through the the install method in TiDatabaseProxy.m but I can't find a reference to create symbolic link, it is correctly using NSFileManager copyItemAtPath", "updateAuthor": { "name": "nick@nicksavvides.com", "key": "nick@nicksavvides.com", "displayName": "Nick", "active": true, "timeZone": "Australia/Sydney" }, "created": "2012-01-07T17:13:57.000+0000", "updated": "2012-01-07T17:13:57.000+0000" }, { "id": "178495", "author": { "name": "learningtechnology", "key": "learningtechnology", "displayName": "Learning Technology", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, I can confirm that I'm also having this issue - it's also duplicating rows instead of updating them so the database is getting bigger and bigger. While it might actually be useful to see what's going on in your database when debugging in the simulator, it is far from desirable to have different functionality between simulator and device - you need to *know* exactly how it's going to behave once deployed. Also, it's very frustrating that things like this keep changing in updates - as if there weren't enough changes to contend with - it would be nice if the updates fixed errors and didn't introduce new ones.\r\n\r\nMany thanks", "updateAuthor": { "name": "learningtechnology", "key": "learningtechnology", "displayName": "Learning Technology", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-09T07:21:54.000+0000", "updated": "2012-01-09T07:21:54.000+0000" }, { "id": "178636", "author": { "name": "peterbranson", "key": "peterbranson", "displayName": "Peter Branson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have also come across this issue, and it is very annoying when trying to develop new functionality. Also when you come to complete your release build you will need to make sure that the database in the resources folder is cleaned, otherwise test data may well be release with your app which is very undesirable.\r\n\r\nMany thanks.", "updateAuthor": { "name": "peterbranson", "key": "peterbranson", "displayName": "Peter Branson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-10T05:35:43.000+0000", "updated": "2012-01-10T05:35:43.000+0000" }, { "id": "179226", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending #1160", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-13T12:23:53.000+0000", "updated": "2012-01-13T12:23:53.000+0000" }, { "id": "179231", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Since the changes made to the database location, the database is now located at \r\n$HOME/Library/Application Support/iPhone Simulator/5.0/Applications/D30F4B39-8A41-4B7F-A271-4EAF69AFDFC9/Library/Private Documents/myDB.sql", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-13T12:55:25.000+0000", "updated": "2012-01-13T12:55:25.000+0000" }, { "id": "179308", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.9.0.v20120113170134 on Simulator 5.0 and iPod 4.3.3", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-13T17:39:53.000+0000", "updated": "2012-01-13T17:39:53.000+0000" }, { "id": "181281", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Open to add label\r\n", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-31T15:53:35.000+0000", "updated": "2012-01-31T15:53:35.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }