{"action":"created","issue":{"url":"https://api.github.com/repos/payara/Payara/issues/1074","repository_url":"https://api.github.com/repos/payara/Payara","labels_url":"https://api.github.com/repos/payara/Payara/issues/1074/labels{/name}","comments_url":"https://api.github.com/repos/payara/Payara/issues/1074/comments","events_url":"https://api.github.com/repos/payara/Payara/issues/1074/events","html_url":"https://github.com/payara/Payara/issues/1074","id":174377869,"number":1074,"title":"Is it possible to configure deployment for doesn't process each persistence unit?","user":{"login":"edilmar","id":428673,"avatar_url":"https://avatars.githubusercontent.com/u/428673?v=3","gravatar_id":"","url":"https://api.github.com/users/edilmar","html_url":"https://github.com/edilmar","followers_url":"https://api.github.com/users/edilmar/followers","following_url":"https://api.github.com/users/edilmar/following{/other_user}","gists_url":"https://api.github.com/users/edilmar/gists{/gist_id}","starred_url":"https://api.github.com/users/edilmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edilmar/subscriptions","organizations_url":"https://api.github.com/users/edilmar/orgs","repos_url":"https://api.github.com/users/edilmar/repos","events_url":"https://api.github.com/users/edilmar/events{/privacy}","received_events_url":"https://api.github.com/users/edilmar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/payara/Payara/labels/1:Wait","name":"1:Wait","color":"c2e0c6"},{"url":"https://api.github.com/repos/payara/Payara/labels/c:Question","name":"c:Question","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"OndrejM","id":2195988,"avatar_url":"https://avatars.githubusercontent.com/u/2195988?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejM","html_url":"https://github.com/OndrejM","followers_url":"https://api.github.com/users/OndrejM/followers","following_url":"https://api.github.com/users/OndrejM/following{/other_user}","gists_url":"https://api.github.com/users/OndrejM/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejM/subscriptions","organizations_url":"https://api.github.com/users/OndrejM/orgs","repos_url":"https://api.github.com/users/OndrejM/repos","events_url":"https://api.github.com/users/OndrejM/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejM/received_events","type":"User","site_admin":false},"assignees":[{"login":"OndrejM","id":2195988,"avatar_url":"https://avatars.githubusercontent.com/u/2195988?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejM","html_url":"https://github.com/OndrejM","followers_url":"https://api.github.com/users/OndrejM/followers","following_url":"https://api.github.com/users/OndrejM/following{/other_user}","gists_url":"https://api.github.com/users/OndrejM/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejM/subscriptions","organizations_url":"https://api.github.com/users/OndrejM/orgs","repos_url":"https://api.github.com/users/OndrejM/repos","events_url":"https://api.github.com/users/OndrejM/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejM/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-08-31T21:01:51Z","updated_at":"2016-09-07T13:37:56Z","closed_at":null,"body":"I have an webapp in Payara 4.1.1.162 + JPA + Hibernate 4.3.\r\nMy webapp has more than 20 PUs, because it needs to look for data in many databases.\r\nBut these databases aren't neeeded at the same time, there are options in the menu that\r\nuse one or other database at this time. I would like to know if it is possible to configure\r\nPayara/JPA/Hibernate to doesn't do the initial check of databases at deploy time, leaving\r\nit for a time it will be needed at running time, on demand of first user interaction.\r\nInformações:   HHH000204: Processing PersistenceUnitInfo [\r\n\tname: myPU1\r\n\t...]\r\nInformações:   HHH000204: Processing PersistenceUnitInfo [\r\n\tname: myPU2\r\n\t...]\r\n etc\r\nThis part of deployment is the main processing time, then the webapp is deployed\r\nmore than 4 minutes. If I disable the majority of the PUs, leaving just one, the deployment\r\nis very fast."},"comment":{"url":"https://api.github.com/repos/payara/Payara/issues/comments/245282787","html_url":"https://github.com/payara/Payara/issues/1074#issuecomment-245282787","issue_url":"https://api.github.com/repos/payara/Payara/issues/1074","id":245282787,"user":{"login":"OndrejM","id":2195988,"avatar_url":"https://avatars.githubusercontent.com/u/2195988?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejM","html_url":"https://github.com/OndrejM","followers_url":"https://api.github.com/users/OndrejM/followers","following_url":"https://api.github.com/users/OndrejM/following{/other_user}","gists_url":"https://api.github.com/users/OndrejM/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejM/subscriptions","organizations_url":"https://api.github.com/users/OndrejM/orgs","repos_url":"https://api.github.com/users/OndrejM/repos","events_url":"https://api.github.com/users/OndrejM/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejM/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T13:37:56Z","updated_at":"2016-09-07T13:37:56Z","body":"I checked the behavior of Payara thorughly and it seems that every persistence unit that is injected through either EMF or EM, is being validated by Payara at deployment, at least when the bundled eclipselink is used. There is nothing that can be do about it other than request an enhancement to provide an option not to validate persistence units. \r\n\r\nA workaround that should work would be to retrieve EM dynamically using `SessionContext`, like this (copied from the JPA specification PDF):\r\n\r\n```\r\n@Stateless\r\n@PersistenceContext(name=\"OrderEM\")\r\npublic class MySessionBean implements MyInterface {\r\n  @Resource SessionContext ctx;\r\n\r\n  public void doSomething() {\r\n    EntityManager em = (EntityManager)ctx.lookup(\"OrderEM\");\r\n     ...\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"OndrejM"}}