Bug 780746 (SOA-3199)

Summary: Two JPA sources cannot share the same db schema
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: Documentation, EDSAssignee: Default User <jbpapp-maint>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.2.0 ER1   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-3199
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 16:16:39 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:
Attachments:
Description Flags
server.log
none
modeshape-config.xml none

Description Jiri Pechanec 2011-07-21 06:12:04 UTC
Affects: Documentation (Ref Guide, User Guide, etc.), Release Notes
project_key: SOA

I have configured two repositories that have two JPA sources sharing the same database schema. Both repositories uses workspace named default.

Such configuration was valid in 5.1 but it does not work in 5.2 any longer. The problem is that two records with the same name are created in dna_workspaces table

soaesb1=> select * from dna_workspaces;
 id |  name   
----+---------
  1 | default
  2 | default
  5 | system
(3 rows)

Which breaks the code in WorkspaceEntity class

        Query query = manager.createNamedQuery("WorkspaceEntity.findByName");
        query.setParameter("name", name);
        query.setHint("org.hibernate.cacheable", true);
        try {
            return (WorkspaceEntity)query.getSingleResult();

as the query findByName with parameter default returns non-unique result

Comment 1 Jiri Pechanec 2011-07-21 06:13:37 UTC
Attachment: Added: server.log
Attachment: Added: modeshape-config.xml


Comment 2 Jiri Pechanec 2011-07-21 07:33:36 UTC
From: Randall Hauch <rhauch>
Date: July 20, 2011 2:36:33 PM CDT
To: Van Halbert <vhalbert>
Subject: Re: Questions


On Jul 20, 2011, at 2:31 PM, Van Halbert wrote:

Is supported a configuration when two (or more) repositories shares the same JPA sources? 

No. Two repositories can use the same DB only when those repositories are clustered, but it makes no sense to cluster 2 repositories in the same engine.

And second is supported the configuration when two JPA sources uses the same db schema?

No, each JPA source has to have it's own DB schema (tables).

Comment 3 Len DiMaggio 2011-07-21 16:14:00 UTC
Re-opening to set doc and rel note flags.

Comment 4 Len DiMaggio 2011-07-21 16:14:58 UTC
Affects: Added: [Documentation (Ref Guide, User Guide, etc.), Release Notes]