Hi Amila,

If what you are saying is correct, this would mean that every query added
to G-Reg wont work when mounted, which is a little puzzling since this only
popped up in AM. Could this be something related to configuration itself,
as in you mounted governance but not the config space?

Thanks,
Senaka.

On Fri, Jan 4, 2013 at 12:51 PM, Amila De Silva <[email protected]> wrote:

>
> Hi,
> As explained in [1] an exception is thrown when accessing the pubisher and
> store apps.
> When these are accessed for the first time, an SQL resource is added to
> the location
> "/repository/components/org.wso2.carbon.registry/queries/tag-summary" of
> the config space.
> Within the publisher app, following code is used to obtain the related
> registry space;
>
> Registry configRegistry =
> ServiceReferenceHolder.getInstance().getRegistryService().getConfigSystemRegistry();
>
> As observed following takes place in the registry side, after calling the
> configRegistry.put method;
> 1. Since the inserted resource is marked as an SQL media type, at a 
> pointSQLQueryHandler.putis called.
> 2.The location of the resource is identified as a non existing one,
> therefore it gets created level by level.
> 3.The new location gets created by addEmptyCollection method in 
> Repositoryclass, which is recursively called until an existing 
> parentResourceID is
> found.
> 4. Once it reaches an existing parentResourceID (in this case it is
> /_system/local/repository/), the immediate child collection (components) is
> created in the underlying database by resourceDAO.add method.
> 5. This subsequently calls to createAndApplyResourceID in
> JDBCResourceDAO, which ultimately calls to createResourceID.
> 6. The problem originates when executing the block;
>
>  JDBCDatabaseTransaction.ManagedRegistryConnection conn =
>                         JDBCDatabaseTransaction.getConnection();
>                 JDBCPathCache pathCache = JDBCPathCache.getPathCache();
>                 int pathID = pathCache.getPathID(conn, path);
>                 if (pathID == -1) {
>                     pathID = pathCache.addEntry(path, parentPathID);
>                 }
>
> "conn" variable points to the database where local space is stored,
> meaning that the pathID is first fetched from the local_space (which is the
> expected behaviour).
>
> The call to  pathCache.addEntry, subsequently invokes
>
> dataAccessManager =
> CurrentSession.getUserRegistry().getRegistryContext().getDataAccessManager();
>
> to get a datasource (the new collection 'components' gets actually stored
> here). But this datasource actually points to the database where config
> space is mounted.
> The problem in short is path is retrieved from one location, but it is
> stored to another.
>
> Has this to do anything with the way the registry space is obtained?
>
> [1] https://wso2.org/jira/browse/APIMANAGER-869
>
>
> Regards,
> AmilaD
>
>


-- 
* <http://wso2con.com/>
*
*

Senaka Fernando*
Member - Integration Technologies Management Committee;
Technical Lead; WSO2 Inc.; http://wso2.com*
Member; Apache Software Foundation; http://apache.org

E-mail: senaka AT wso2.com
**P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818
Linked-In: http://linkedin.com/in/senakafernando

*Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to