You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Märker, Mathias <Ma...@tt-s.com> on 2015/09/21 07:48:31 UTC

Olingo v2 and CDI

Hi all,
I have two questions.
First, my JPAFactory and JPAEdmExtension class is run through at every http call I make. It seems a bit useless to create my metadata every time again, is there a way to prevent this?
Second question, I use CDI in my Application and wanted to inject something, which is not possible, probably because the Factory is created with new Factory().. I just wanted to know if there is an easy and predefined way to use injection via CDI or not in Olingo.

Regards
Mathias


RE: Olingo v2 and CDI

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Mathis,

true a lot of clients would break if the metadata changes between requests. The point is that the specifications says your can do it so we as a library can`t assume per default that it does not change after deployment. But you definitely do have a valid feature request. It is just not yet implemented :)

Best Regards,
Christian

From: Märker, Mathias [mailto:Mathias.Maerker@tt-s.com]
Sent: Montag, 21. September 2015 10:47
To: user@olingo.apache.org
Subject: AW: Olingo v2 and CDI

Hi Christian,
I will look into the CDI option for sure and if I am able to produce anything useful I will let you know :).

As for the metadata I really don't see the REST point here. But maybe I am just too inexperienced in that Area. Is a Service Document really something that can and should be changed during the course of a http session? The libraries I know normally read the metadata once at startup of the applications and assume that it stays unchanged. So if I would change it at runtime, the application will break because maybe there is all of a sudden something missing which was there before?

Regards
Mathias

Von: Amend, Christian [mailto:christian.amend@sap.com]
Gesendet: Montag, 21. September 2015 10:38
An: user@olingo.apache.org<ma...@olingo.apache.org>
Betreff: RE: Olingo v2 and CDI

Hi Mathias,

The metadata is created again for each request since OData is based on REST principles and thus stateless. If your use case calls for a more static metadata which can be cached you can open a JIRA issue here: https://issues.apache.org/jira/browse/OLINGO/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel where you can request this feature. Also all contributions are welcome :)

CDI in combination with the JPAFactory has not been implemented by us. So there is no predefined way for now. If you find a suitable place to inject resources and would like to contribute such a feature let me know.

Best Regards,
Christian

From: Märker, Mathias [mailto:Mathias.Maerker@tt-s.com]
Sent: Montag, 21. September 2015 07:49
To: user@olingo.apache.org<ma...@olingo.apache.org>
Subject: Olingo v2 and CDI

Hi all,
I have two questions.
First, my JPAFactory and JPAEdmExtension class is run through at every http call I make. It seems a bit useless to create my metadata every time again, is there a way to prevent this?
Second question, I use CDI in my Application and wanted to inject something, which is not possible, probably because the Factory is created with new Factory().. I just wanted to know if there is an easy and predefined way to use injection via CDI or not in Olingo.

Regards
Mathias


AW: Olingo v2 and CDI

Posted by Märker, Mathias <Ma...@tt-s.com>.
Hi Christian,
I will look into the CDI option for sure and if I am able to produce anything useful I will let you know :).

As for the metadata I really don't see the REST point here. But maybe I am just too inexperienced in that Area. Is a Service Document really something that can and should be changed during the course of a http session? The libraries I know normally read the metadata once at startup of the applications and assume that it stays unchanged. So if I would change it at runtime, the application will break because maybe there is all of a sudden something missing which was there before?

Regards
Mathias

Von: Amend, Christian [mailto:christian.amend@sap.com]
Gesendet: Montag, 21. September 2015 10:38
An: user@olingo.apache.org
Betreff: RE: Olingo v2 and CDI

Hi Mathias,

The metadata is created again for each request since OData is based on REST principles and thus stateless. If your use case calls for a more static metadata which can be cached you can open a JIRA issue here: https://issues.apache.org/jira/browse/OLINGO/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel where you can request this feature. Also all contributions are welcome :)

CDI in combination with the JPAFactory has not been implemented by us. So there is no predefined way for now. If you find a suitable place to inject resources and would like to contribute such a feature let me know.

Best Regards,
Christian

From: Märker, Mathias [mailto:Mathias.Maerker@tt-s.com]
Sent: Montag, 21. September 2015 07:49
To: user@olingo.apache.org<ma...@olingo.apache.org>
Subject: Olingo v2 and CDI

Hi all,
I have two questions.
First, my JPAFactory and JPAEdmExtension class is run through at every http call I make. It seems a bit useless to create my metadata every time again, is there a way to prevent this?
Second question, I use CDI in my Application and wanted to inject something, which is not possible, probably because the Factory is created with new Factory().. I just wanted to know if there is an easy and predefined way to use injection via CDI or not in Olingo.

Regards
Mathias


RE: Olingo v2 and CDI

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Mathias,

The metadata is created again for each request since OData is based on REST principles and thus stateless. If your use case calls for a more static metadata which can be cached you can open a JIRA issue here: https://issues.apache.org/jira/browse/OLINGO/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel where you can request this feature. Also all contributions are welcome :)

CDI in combination with the JPAFactory has not been implemented by us. So there is no predefined way for now. If you find a suitable place to inject resources and would like to contribute such a feature let me know.

Best Regards,
Christian

From: Märker, Mathias [mailto:Mathias.Maerker@tt-s.com]
Sent: Montag, 21. September 2015 07:49
To: user@olingo.apache.org
Subject: Olingo v2 and CDI

Hi all,
I have two questions.
First, my JPAFactory and JPAEdmExtension class is run through at every http call I make. It seems a bit useless to create my metadata every time again, is there a way to prevent this?
Second question, I use CDI in my Application and wanted to inject something, which is not possible, probably because the Factory is created with new Factory().. I just wanted to know if there is an easy and predefined way to use injection via CDI or not in Olingo.

Regards
Mathias