{"action":"created","issue":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/1041","repository_url":"https://api.github.com/repos/Raizlabs/DBFlow","labels_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/1041/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/1041/comments","events_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/1041/events","html_url":"https://github.com/Raizlabs/DBFlow/issues/1041","id":185487538,"number":1041,"title":"Leaking TransactionQueue when no @Table is defined for @Database [low priority]","user":{"login":"mickele","id":17647,"avatar_url":"https://avatars.githubusercontent.com/u/17647?v=3","gravatar_id":"","url":"https://api.github.com/users/mickele","html_url":"https://github.com/mickele","followers_url":"https://api.github.com/users/mickele/followers","following_url":"https://api.github.com/users/mickele/following{/other_user}","gists_url":"https://api.github.com/users/mickele/gists{/gist_id}","starred_url":"https://api.github.com/users/mickele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickele/subscriptions","organizations_url":"https://api.github.com/users/mickele/orgs","repos_url":"https://api.github.com/users/mickele/repos","events_url":"https://api.github.com/users/mickele/events{/privacy}","received_events_url":"https://api.github.com/users/mickele/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T19:29:14Z","updated_at":"2016-11-02T12:13:30Z","closed_at":"2016-11-02T12:13:30Z","body":"DBFlow Version: **3+** I believe (reproduced on HEAD)\nIssue Kind (Bug, Question, Feature): **Bug**\n\nDescription: \nI consider this low priority since usually when you declare a `@Database` you want to declare at least one `@Table` for it, even when testing.\n\nI'll try to explain the best way I can, but the tl;dr; is:\nA `@Database` with no `@Table` will not be registered at the `DatabaseHolder` and its `TransactionQueue` will never be interrupted which results in 1 thread waiting.\n\n**Detailed version:**\n1. In the tests of DBFlow there's a `@Database` declared at `myDB.java`\n2. There's no `@Table` declaration for this database\n3. The constructor of the generated `myDBtest_Database.java` (extends DatabaseDefinition) will be inserted at the `GeneratedDatabaseHolder`\n4. The constructor of the `DatabaseDefinition` will create a `TransactionManager` for its own, which will create a `DefaultTransactionQueue/Thread` and wait\n5. `myDBtest_Database` will never call `DatabaseHolder#putDatabaseForTable` since there's no table declared for it and because of that, none of the `DatabaseHolder` maps will be populated with the myDB-related classes\n6. When `FlowManager` is being reset/destroyed and the `globalDatabaseHolder.databaseClassLookupMap` is being scanned, it won't find any myDB-related classes and won't stop the TransactionQueue created at step 4.\n\nI think a fix would be to DatabaseHolder also register a database without Tables, with a simple `putDatabase` that takes no `Table` param or not injecting this database definition at the `GeneratedDatabaseHolder` if no `@Table` was defined.\n\nBut to be honest I don't know if this is the best solution and/or viable. What do you think?\n"},"comment":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/comments/257847637","html_url":"https://github.com/Raizlabs/DBFlow/issues/1041#issuecomment-257847637","issue_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/1041","id":257847637,"user":{"login":"agrosner","id":2117859,"avatar_url":"https://avatars.githubusercontent.com/u/2117859?v=3","gravatar_id":"","url":"https://api.github.com/users/agrosner","html_url":"https://github.com/agrosner","followers_url":"https://api.github.com/users/agrosner/followers","following_url":"https://api.github.com/users/agrosner/following{/other_user}","gists_url":"https://api.github.com/users/agrosner/gists{/gist_id}","starred_url":"https://api.github.com/users/agrosner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrosner/subscriptions","organizations_url":"https://api.github.com/users/agrosner/orgs","repos_url":"https://api.github.com/users/agrosner/repos","events_url":"https://api.github.com/users/agrosner/events{/privacy}","received_events_url":"https://api.github.com/users/agrosner/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T12:13:30Z","updated_at":"2016-11-02T12:13:30Z","body":"fixed issue now in `develop`."}}
{"actor":{"display_login":"agrosner"}}