{"action":"created","issue":{"url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/20","repository_url":"https://api.github.com/repos/mincong-h/gsoc-hsearch","labels_url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/20/comments","events_url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/20/events","html_url":"https://github.com/mincong-h/gsoc-hsearch/issues/20","id":158543794,"number":20,"title":"How to disable the cache in a session ?","user":{"login":"mincong-h","id":10179217,"avatar_url":"https://avatars.githubusercontent.com/u/10179217?v=3","gravatar_id":"","url":"https://api.github.com/users/mincong-h","html_url":"https://github.com/mincong-h","followers_url":"https://api.github.com/users/mincong-h/followers","following_url":"https://api.github.com/users/mincong-h/following{/other_user}","gists_url":"https://api.github.com/users/mincong-h/gists{/gist_id}","starred_url":"https://api.github.com/users/mincong-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mincong-h/subscriptions","organizations_url":"https://api.github.com/users/mincong-h/orgs","repos_url":"https://api.github.com/users/mincong-h/repos","events_url":"https://api.github.com/users/mincong-h/events{/privacy}","received_events_url":"https://api.github.com/users/mincong-h/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mincong-h","id":10179217,"avatar_url":"https://avatars.githubusercontent.com/u/10179217?v=3","gravatar_id":"","url":"https://api.github.com/users/mincong-h","html_url":"https://github.com/mincong-h","followers_url":"https://api.github.com/users/mincong-h/followers","following_url":"https://api.github.com/users/mincong-h/following{/other_user}","gists_url":"https://api.github.com/users/mincong-h/gists{/gist_id}","starred_url":"https://api.github.com/users/mincong-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mincong-h/subscriptions","organizations_url":"https://api.github.com/users/mincong-h/orgs","repos_url":"https://api.github.com/users/mincong-h/repos","events_url":"https://api.github.com/users/mincong-h/events{/privacy}","received_events_url":"https://api.github.com/users/mincong-h/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-06-05T08:19:01Z","updated_at":"2016-06-05T15:29:58Z","closed_at":null,"body":"In the official hibernate search implementation, there's possibility to ignore the cache in a hibernate search session : \r\n\r\n```java\r\nfullTextEntityManager\r\n    // Delete existing index and rebuild, for all Address instances\r\n    .createIndexer(Address.class)\r\n    // Batch of 10000 objects per query\r\n    .batchSizeToLoadObjects(10000)\r\n    // CacheMode.IGNORE:\r\n    // The session will never interact with the cache, except to \r\n    // invalidate cache items when updates occur\r\n    .cacheMode(CacheMode.IGNORE)\r\n    // 4 parallel threads to load the Address instances\r\n    // They will also need to process indexed embedded relations and\r\n    // custom FieldBridges to finally output a Lucene document\r\n    .threadsToLoadObjects(4)\r\n    // Time out in 3600 seconds for its transactions\r\n    // these transactions are read-only\r\n    .transactionTimeout(3600)\r\n    // The MassIndexer uses a forward-only scrollable result to iterate\r\n    // on the primary keys to be loaded, but MySQL’s JDBC driver will\r\n    // load all values in memory. To avoid this \"optimization\", set \r\n    // idFetchSize to Integer.MIN_VALUE.\r\n    .idFetchSize(Integer.MIN_VALUE)\r\n    // run in asynchronous way\r\n    .start();\r\n```\r\n\r\nCan I do the same thing in my own implementation ? The motivation is giving a more objective comparison to issue #4 Why JSR 352 can increase performance ?"},"comment":{"url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/comments/223819540","html_url":"https://github.com/mincong-h/gsoc-hsearch/issues/20#issuecomment-223819540","issue_url":"https://api.github.com/repos/mincong-h/gsoc-hsearch/issues/20","id":223819540,"user":{"login":"mincong-h","id":10179217,"avatar_url":"https://avatars.githubusercontent.com/u/10179217?v=3","gravatar_id":"","url":"https://api.github.com/users/mincong-h","html_url":"https://github.com/mincong-h","followers_url":"https://api.github.com/users/mincong-h/followers","following_url":"https://api.github.com/users/mincong-h/following{/other_user}","gists_url":"https://api.github.com/users/mincong-h/gists{/gist_id}","starred_url":"https://api.github.com/users/mincong-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mincong-h/subscriptions","organizations_url":"https://api.github.com/users/mincong-h/orgs","repos_url":"https://api.github.com/users/mincong-h/repos","events_url":"https://api.github.com/users/mincong-h/events{/privacy}","received_events_url":"https://api.github.com/users/mincong-h/received_events","type":"User","site_admin":false},"created_at":"2016-06-05T15:29:57Z","updated_at":"2016-06-05T15:29:57Z","body":"```java\r\naddresses = em\r\n    .createQuery(q)\r\n    // don't insert into cache.\r\n    .setHint(\"javax.persistence.cache.storeMode\", \"BYPASS\")\r\n    // get data directly from the database.\r\n    .setHint(\"javax.persistence.cache.retrieveMode\", \"BYPASS\")\r\n    .getResultList();    \r\n```"}}
{"actor":{"display_login":"mincong-h"}}