Bug 1059599
| Summary: | Duplicated schema export for JPA binding | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Fuse Service Works 6 | Reporter: | Václav Chalupa <vchalupa> | ||||
| Component: | SwitchYard | Assignee: | Tomohisa Igarashi <toigaras> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | Jiri Sedlacek <jsedlace> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0.0 | CC: | atangrin, kconner, mvecera, oskutka, soa-p-jira | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2014-08-19 15:10:56 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1061176 | ||||||
| Attachments: |
|
||||||
I think there's nothing to do on Switchyard/camel side. camel-jpa is just calling Persistence.createEntityManagerFactory(). Hibernate should be able to avoid SchemaExport invocation on it. |
Created attachment 857394 [details] Reproducer If SwitchYard JPA binding is not in a global managed transaction, schema export for DB creation is performed twice. First schema export is performed by deployment (it is ok), second and identical schema export is performed by firt JPA binding invocation. When a user has some kind of DB inicialization after an application deployment, this inicialization is lost after JPA binding invocation, as the DB schema is recreated. This issue causes problems if hibernate.hbm2ddl.auto in persistence.xml is set to create-drop or create. Reproducer application attached. Schema export by deployment: ............................ 07:36:25,127 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 126) HHH000227: Running hbm2ddl schema export 07:36:25,128 INFO [stdout] (ServerService Thread Pool -- 126) Hibernate: 07:36:25,128 INFO [stdout] (ServerService Thread Pool -- 126) drop table DBEntity if exists 07:36:25,128 INFO [stdout] (ServerService Thread Pool -- 126) Hibernate: 07:36:25,128 INFO [stdout] (ServerService Thread Pool -- 126) create table DBEntity ( 07:36:25,128 INFO [stdout] (ServerService Thread Pool -- 126) id bigint generated by default as identity, 07:36:25,129 INFO [stdout] (ServerService Thread Pool -- 126) command varchar(255) not null, 07:36:25,129 INFO [stdout] (ServerService Thread Pool -- 126) primary key (id) 07:36:25,129 INFO [stdout] (ServerService Thread Pool -- 126) ) 07:36:25,129 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 126) HHH000230: Schema export complete And again by first service invocation: ...................................... 07:36:25,634 INFO [stdout] (http-localhost/127.0.0.1:8080-16) FrontService :: Received command 'process' ... 07:36:25,656 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (http-localhost/127.0.0.1:8080-16) HHH000227: Running hbm2ddl schema export 07:36:25,657 INFO [stdout] (http-localhost/127.0.0.1:8080-16) Hibernate: 07:36:25,657 INFO [stdout] (http-localhost/127.0.0.1:8080-16) drop table DBEntity if exists 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) Hibernate: 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) create table DBEntity ( 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) id bigint generated by default as identity, 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) command varchar(255) not null, 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) primary key (id) 07:36:25,658 INFO [stdout] (http-localhost/127.0.0.1:8080-16) ) 07:36:25,658 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (http-localhost/127.0.0.1:8080-16) HHH000230: Schema export complete