[ 
https://issues.apache.org/jira/browse/COCOON-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Grzegorz Kossakowski updated COCOON-2106:
-----------------------------------------


Argh, I forgot that DataSourceComponent and DataSource are incompatible.

This proves that we need to register wrapper components for Spring datasources. 
Actually, such wrapper is already implemented in 
org.apache.cocoon.core.container.spring.avalon.SpringToAvalonDataSourceBridge.SpringDataSourceWrapper.
 The question is how to automatically register such wrapper for all Spring 
datasources? I have two solutions in mind:
1. Implement registration in 
org.apache.cocoon.core.container.spring.avalon.BridgeElementParser class. The 
advantage of this method is that BridgeElementParser has all needed 
functionality already in place. The disadvantage is that BridgeElementParser is 
in cocoon-sitemap-impl and implementing wrapper registration there would 
introduce dependency on database stuff.
2. Implement new ElementParser in cocoon-database-impl just for wrappers 
registration. The advantage is that dependencies stay clean. Shortcoming is 
that we need to introduce new XMLSchema and register parser for Spring 
configuration files just to register few wrappers.

Is there any simpler method? Carsten, could you help us again? :)

> DatabaseReader and SQLTransformer cannot obtain datasource
> ----------------------------------------------------------
>
>                 Key: COCOON-2106
>                 URL: https://issues.apache.org/jira/browse/COCOON-2106
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Databases
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Kazó Csaba
>            Assignee: Grzegorz Kossakowski
>         Attachments: dbreader.diff, sqltrans.diff
>
>
> The DatabaseReader and SQLTransformer components fail to obtain the 
> configured data source and throw a ServiceException like "Component with 
> 'org.apache.avalon.excalibur.datasource.DataSourceComponent/personnel' is not 
> defined in this service manager. (Key='AvalonServiceManager')". The failing 
> function call in both cases is:
> this.manager.lookup(DataSourceComponent.ROLE + '/' + datasourceName)
> The result is the same regardless of whether the data source is defined as an 
> Avalon component or a Spring bean.
> Changing the code to use ServiceSelector as in the "Creating a Reader" 
> document [1] and the modular database actions solves the problem for both 
> cases. The attached patch applies this modification to DatabaseReader.java.
> [1] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g2/g1/g2/681.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to