Bug 780746 (SOA-3199) - Two JPA sources cannot share the same db schema
Summary: Two JPA sources cannot share the same db schema
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-3199
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, EDS
Version: 5.2.0 ER1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: Default User
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-21 06:12 UTC by Jiri Pechanec
Modified: 2011-07-21 16:16 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 16:16:39 UTC
Type: Bug


Attachments (Terms of Use)
server.log (259.33 KB, text/plain)
2011-07-21 06:13 UTC, Jiri Pechanec
no flags Details
modeshape-config.xml (21.19 KB, text/xml)
2011-07-21 06:13 UTC, Jiri Pechanec
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-3199 0 None None None Never

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]



Note You need to log in before you can comment on or make changes to this bug.