[
https://issues.apache.org/jira/browse/OLINGO-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13873604#comment-13873604
]
M Carissimi commented on OLINGO-118:
------------------------------------
Hello Michael,
the only remaining question I have is about caching of the schemas. I have
already attempted to cache the schema list in my custom EdmProvider in the
getSchemas() method, but this has had no effect.
{code}
private List<Schema> schemas = new ArrayList<Schema>();
...
public List<Schema> getSchemas() throws ODataException
{
if (schemas.size() == 0)
{
Schema schema = new Schema();
...
schemas.add(schema);
}
return schemas;
}
{code}
Running the code in debugging mode, I can see that method createService() of
the service factory class configured as initi-parameter of the
CXFNonSpringJaxrsServlet servlet is invoked during each invocation and this
forces the creation of a new EdmProvider class on each invocation
{code}
private ODataService theODataService = null;
...
@Override
public ODataService createService(ODataContext ctx) throws ODataException
{
if (theODataService == null)
{
EdmProvider edmProvider = new ResourceNoLinksProvider();
ODataSingleProcessor singleProcessor = new ResourceSingleProcessor();
theODataService = createODataSingleProcessorService(edmProvider,
singleProcessor);
}
return theODataService;
}
{code}
Do you have any other suggestion about caching the schemas or metadata? In
odata4j, we were able to cache the metadata represented by EdmDataServices
using a similar approach to the one above. The main difference is that the
factory class was invoked by Jesey rather than CXF.
Regards
Miki
> Typing of odata entry properties
> --------------------------------
>
> Key: OLINGO-118
> URL: https://issues.apache.org/jira/browse/OLINGO-118
> Project: Olingo
> Issue Type: Question
> Affects Versions: V2 1.1.0
> Reporter: M Carissimi
> Assignee: Michael Bolz
> Attachments: odata4j output.xml, olingo output.xml
>
>
> Hello,
> I am migrating an odata service from odata4j to olingo. During creation of
> single odata entries or odata feeds, odata4j allows you to specify the type
> of each property element. How can this be achieved in olingo? See attached
> xml feeds for an entry generated in odata4j and one generated in olingo.
> We generate the metadata at runtime using custom database queries and in
> odata4j we can cache the metadata document to avoid having to rebuild it
> every time a request is received. How can metadata be cached between requests
> in olingo? Following the simple read example on the olingo website, we use an
> ODataServiceFactory to create a service using method
> createODataSingleProcessorService(), but these methods are invoked during
> each request.
> Cheers
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)