Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » The Hibernate resource query does not work in the latest TENEO build
The Hibernate resource query does not work in the latest TENEO build [message #118027] |
Sat, 12 April 2008 21:03  |
Eclipse User |
|
|
|
I was using up till now the TENEO build from September 2007.
I wanted to take advantage of the latest fixes and loaded the TENEO
I200804102324 build.
With this build my queries do not execute any more.
Here is my code:
Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
"hibernate", new HibernateResourceFactory() {
@Override
public Resource createResource(URI uri) {
return new HibernateResource(uri);
}
});
String queryStr = "hibernate://?dsname=my_database?query1=from part"
URI queryURI = URI.createURI(queryStr); Resource r1 =
resourceSet.createResource (queryURI);
This used to work fine and return all the entries in the table "part".
Withe the new version of TENEO, I get an empty list. I debug trough the
code but code not find where it fails. It just create a new
HibernateResource but has not data.
Any help? What is the difference?
I also loaded the latest EMF M200803121150 and no difference.
Do I need to regenerate the classes from the eCore or can I use the code
that I have (EMF 2.3.1)
Thanks
Yigal
|
|
| | |
Re: The Hibernate resource query does not work in the latest TENEO build [message #118076 is a reply to message #118065] |
Sun, 13 April 2008 08:51   |
Eclipse User |
|
|
|
Hi Yigal,
Can you put a breakpoint in the HibernateResource.loadResource method? From there you can debug, the
system should go into the loadFromStore method and then into the loadUsingDefinedQueries method (if
there are defined queries in your uri). If you debug this, do you see that a query is executed? Or
what do you see when you debug through the load process?
The log shows that Teneo sees that you want to load using a query.
gr. Martin
Yigal wrote:
> Hi Martin,
> I never got into a method loadUsingDefinedQueries(). I had logging
> turned on and have nothing coming into the log.
> I used your log4j.properties (Even thou mine looked the same) and
> attaching the result of query that should return 3 rows.
> As you see in the log, nothing happens.
>
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> During debugging did you end up in the
>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>> is correct and it returns an empty list then the issue is related to
>> hibernate (or your database is empty).
>> Did you enable hibernate logging? See here for an example log4j file:
>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> I was using up till now the TENEO build from September 2007.
>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>> I200804102324 build.
>>> With this build my queries do not execute any more.
>>> Here is my code:
>>>
>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>> "hibernate", new HibernateResourceFactory() {
>>> @Override
>>> public Resource createResource(URI uri) {
>>> return new HibernateResource(uri);
>>> }
>>> });
>>>
>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>> resourceSet.createResource (queryURI);
>>>
>>> This used to work fine and return all the entries in the table "part".
>>>
>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>> the code but code not find where it fails. It just create a new
>>> HibernateResource but has not data.
>>>
>>> Any help? What is the difference?
>>>
>>> I also loaded the latest EMF M200803121150 and no difference.
>>> Do I need to regenerate the classes from the eCore or can I use the
>>> code that I have (EMF 2.3.1)
>>>
>>> Thanks
>>> Yigal
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: The Hibernate resource query does not work in the latest TENEO build [message #118097 is a reply to message #118087] |
Sun, 13 April 2008 09:30   |
Eclipse User |
|
|
|
Hi Yigal,
Yes I understand, but I am interested to know where the load process then ends up. Just knowing that
you did not get into the loadUsingDefinedQueries method does not give me enough info I am afraid.
Can you put a breakpoint in StoreResource.load and then debug from there?
With defined queries the execution path should:
StoreResource.load
HibernateResource.loadResource
HibernateResource.loadFromStore
HibernateResource.loadUsingDefinedQueries
The HibernateResource.loadResource method logs the message "Loading resource:...", as I don't see it
in your log I am pretty sure that you won't even get there, so where in the StoreResource.load
method does it stop/go away? Do you get into the StoreResource.load method at all?
gr. Martin
Yigal wrote:
> Martin,
> When I debug I did not get into any method called
> loadUsingDefinedQueries ().
> I'm attaching the log4j part that shows there is no activity.
> This query should return 3 lines and I get nothing.
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> During debugging did you end up in the
>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>> is correct and it returns an empty list then the issue is related to
>> hibernate (or your database is empty).
>> Did you enable hibernate logging? See here for an example log4j file:
>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> I was using up till now the TENEO build from September 2007.
>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>> I200804102324 build.
>>> With this build my queries do not execute any more.
>>> Here is my code:
>>>
>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>> "hibernate", new HibernateResourceFactory() {
>>> @Override
>>> public Resource createResource(URI uri) {
>>> return new HibernateResource(uri);
>>> }
>>> });
>>>
>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>> resourceSet.createResource (queryURI);
>>>
>>> This used to work fine and return all the entries in the table "part".
>>>
>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>> the code but code not find where it fails. It just create a new
>>> HibernateResource but has not data.
>>>
>>> Any help? What is the difference?
>>>
>>> I also loaded the latest EMF M200803121150 and no difference.
>>> Do I need to regenerate the classes from the eCore or can I use the
>>> code that I have (EMF 2.3.1)
>>>
>>> Thanks
>>> Yigal
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #118315 is a reply to message #118097] |
Mon, 14 April 2008 13:26   |
Eclipse User |
|
|
|
Martin,
I did set the brake points as you indicated and I never got to any of them.
As I said before nothing is happening and I do not understand it. It
work with the September release of TENEO but not with the current one.
Any changes in the code that I need to look at and maybe add to my code
to make it work again?
Thanks
Yigal
Martin Taal wrote:
> Hi Yigal,
> Yes I understand, but I am interested to know where the load process
> then ends up. Just knowing that you did not get into the
> loadUsingDefinedQueries method does not give me enough info I am afraid.
>
> Can you put a breakpoint in StoreResource.load and then debug from there?
>
> With defined queries the execution path should:
> StoreResource.load
> HibernateResource.loadResource
> HibernateResource.loadFromStore
> HibernateResource.loadUsingDefinedQueries
>
> The HibernateResource.loadResource method logs the message "Loading
> resource:...", as I don't see it in your log I am pretty sure that you
> won't even get there, so where in the StoreResource.load method does it
> stop/go away? Do you get into the StoreResource.load method at all?
>
> gr. Martin
>
> Yigal wrote:
>> Martin,
>> When I debug I did not get into any method called
>> loadUsingDefinedQueries ().
>> I'm attaching the log4j part that shows there is no activity.
>> This query should return 3 lines and I get nothing.
>>
>> Thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> During debugging did you end up in the
>>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>>> is correct and it returns an empty list then the issue is related to
>>> hibernate (or your database is empty).
>>> Did you enable hibernate logging? See here for an example log4j file:
>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> I was using up till now the TENEO build from September 2007.
>>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>>> I200804102324 build.
>>>> With this build my queries do not execute any more.
>>>> Here is my code:
>>>>
>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>> "hibernate", new HibernateResourceFactory() {
>>>> @Override
>>>> public Resource createResource(URI uri) {
>>>> return new HibernateResource(uri);
>>>> }
>>>> });
>>>>
>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>> resourceSet.createResource (queryURI);
>>>>
>>>> This used to work fine and return all the entries in the table "part".
>>>>
>>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>>> the code but code not find where it fails. It just create a new
>>>> HibernateResource but has not data.
>>>>
>>>> Any help? What is the difference?
>>>>
>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>> Do I need to regenerate the classes from the eCore or can I use the
>>>> code that I have (EMF 2.3.1)
>>>>
>>>> Thanks
>>>> Yigal
>>>
>>>
>>
>
>
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #118324 is a reply to message #118315] |
Mon, 14 April 2008 13:52   |
Eclipse User |
|
|
|
Hi Yigal,
Hmm something I thought of, a change since the september release is that you have to explicitly call
load on a resource. Before this was done automatically when calling getcontents.
Do you call load somewhere explicitly?
gr. Martin
Yigal wrote:
> Martin,
> I did set the brake points as you indicated and I never got to any of them.
> As I said before nothing is happening and I do not understand it. It
> work with the September release of TENEO but not with the current one.
> Any changes in the code that I need to look at and maybe add to my code
> to make it work again?
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> Yes I understand, but I am interested to know where the load process
>> then ends up. Just knowing that you did not get into the
>> loadUsingDefinedQueries method does not give me enough info I am afraid.
>>
>> Can you put a breakpoint in StoreResource.load and then debug from there?
>>
>> With defined queries the execution path should:
>> StoreResource.load
>> HibernateResource.loadResource
>> HibernateResource.loadFromStore
>> HibernateResource.loadUsingDefinedQueries
>>
>> The HibernateResource.loadResource method logs the message "Loading
>> resource:...", as I don't see it in your log I am pretty sure that you
>> won't even get there, so where in the StoreResource.load method does
>> it stop/go away? Do you get into the StoreResource.load method at all?
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> Martin,
>>> When I debug I did not get into any method called
>>> loadUsingDefinedQueries ().
>>> I'm attaching the log4j part that shows there is no activity.
>>> This query should return 3 lines and I get nothing.
>>>
>>> Thanks
>>> Yigal
>>>
>>> Martin Taal wrote:
>>>> Hi Yigal,
>>>> During debugging did you end up in the
>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>> query is correct and it returns an empty list then the issue is
>>>> related to hibernate (or your database is empty).
>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>
>>>> gr. Martin
>>>>
>>>> Yigal wrote:
>>>>> I was using up till now the TENEO build from September 2007.
>>>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>>>> I200804102324 build.
>>>>> With this build my queries do not execute any more.
>>>>> Here is my code:
>>>>>
>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>> "hibernate", new HibernateResourceFactory() {
>>>>> @Override
>>>>> public Resource createResource(URI uri) {
>>>>> return new HibernateResource(uri);
>>>>> }
>>>>> });
>>>>>
>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>> resourceSet.createResource (queryURI);
>>>>>
>>>>> This used to work fine and return all the entries in the table "part".
>>>>>
>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>> trough the code but code not find where it fails. It just create a
>>>>> new HibernateResource but has not data.
>>>>>
>>>>> Any help? What is the difference?
>>>>>
>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>> Do I need to regenerate the classes from the eCore or can I use the
>>>>> code that I have (EMF 2.3.1)
>>>>>
>>>>> Thanks
>>>>> Yigal
>>>>
>>>>
>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #118342 is a reply to message #118324] |
Mon, 14 April 2008 14:25   |
Eclipse User |
|
|
|
Hi Martin,
As you can see from the code below, I do not call "load" explicitly.
That what I was missing. I added the load() and it works.
What are the option to pass to the load(), do you a document explaining it?
Thanks
Yigal
Martin Taal wrote:
> Hi Yigal,
> Hmm something I thought of, a change since the september release is that
> you have to explicitly call load on a resource. Before this was done
> automatically when calling getcontents.
>
> Do you call load somewhere explicitly?
>
> gr. Martin
>
> Yigal wrote:
>> Martin,
>> I did set the brake points as you indicated and I never got to any of
>> them.
>> As I said before nothing is happening and I do not understand it. It
>> work with the September release of TENEO but not with the current one.
>> Any changes in the code that I need to look at and maybe add to my
>> code to make it work again?
>>
>> Thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> Yes I understand, but I am interested to know where the load process
>>> then ends up. Just knowing that you did not get into the
>>> loadUsingDefinedQueries method does not give me enough info I am afraid.
>>>
>>> Can you put a breakpoint in StoreResource.load and then debug from
>>> there?
>>>
>>> With defined queries the execution path should:
>>> StoreResource.load
>>> HibernateResource.loadResource
>>> HibernateResource.loadFromStore
>>> HibernateResource.loadUsingDefinedQueries
>>>
>>> The HibernateResource.loadResource method logs the message "Loading
>>> resource:...", as I don't see it in your log I am pretty sure that
>>> you won't even get there, so where in the StoreResource.load method
>>> does it stop/go away? Do you get into the StoreResource.load method
>>> at all?
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> Martin,
>>>> When I debug I did not get into any method called
>>>> loadUsingDefinedQueries ().
>>>> I'm attaching the log4j part that shows there is no activity.
>>>> This query should return 3 lines and I get nothing.
>>>>
>>>> Thanks
>>>> Yigal
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Yigal,
>>>>> During debugging did you end up in the
>>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>>> query is correct and it returns an empty list then the issue is
>>>>> related to hibernate (or your database is empty).
>>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Yigal wrote:
>>>>>> I was using up till now the TENEO build from September 2007.
>>>>>> I wanted to take advantage of the latest fixes and loaded the
>>>>>> TENEO I200804102324 build.
>>>>>> With this build my queries do not execute any more.
>>>>>> Here is my code:
>>>>>>
>>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>>> "hibernate", new HibernateResourceFactory() {
>>>>>> @Override
>>>>>> public Resource createResource(URI uri) {
>>>>>> return new HibernateResource(uri);
>>>>>> }
>>>>>> });
>>>>>>
>>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>>> resourceSet.createResource (queryURI);
>>>>>>
>>>>>> This used to work fine and return all the entries in the table
>>>>>> "part".
>>>>>>
>>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>>> trough the code but code not find where it fails. It just create
>>>>>> a new HibernateResource but has not data.
>>>>>>
>>>>>> Any help? What is the difference?
>>>>>>
>>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>>> Do I need to regenerate the classes from the eCore or can I use
>>>>>> the code that I have (EMF 2.3.1)
>>>>>>
>>>>>> Thanks
>>>>>> Yigal
>>>>>
>>>>>
>>>>
>>>
>>>
>
>
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #118351 is a reply to message #118342] |
Mon, 14 April 2008 14:45  |
Eclipse User |
|
|
|
Hi Yigal,
There are currently two options which can be passed:
- XMLResource.OPTION_DISABLE_NOTIFY: if set to true then no notifications are send out during load.
This option was used for the gmf integration but this is currently not required anymore for that
integration.
- LOAD_STRATEGY_PARAM: this one is described here:
http://www.elver.org/hibernate/hibernateresources.html#Load+ of+referenced+Objects
gr. Martin
Yigal wrote:
> Hi Martin,
> As you can see from the code below, I do not call "load" explicitly.
> That what I was missing. I added the load() and it works.
>
> What are the option to pass to the load(), do you a document explaining it?
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> Hmm something I thought of, a change since the september release is
>> that you have to explicitly call load on a resource. Before this was
>> done automatically when calling getcontents.
>>
>> Do you call load somewhere explicitly?
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> Martin,
>>> I did set the brake points as you indicated and I never got to any of
>>> them.
>>> As I said before nothing is happening and I do not understand it. It
>>> work with the September release of TENEO but not with the current one.
>>> Any changes in the code that I need to look at and maybe add to my
>>> code to make it work again?
>>>
>>> Thanks
>>> Yigal
>>>
>>> Martin Taal wrote:
>>>> Hi Yigal,
>>>> Yes I understand, but I am interested to know where the load process
>>>> then ends up. Just knowing that you did not get into the
>>>> loadUsingDefinedQueries method does not give me enough info I am
>>>> afraid.
>>>>
>>>> Can you put a breakpoint in StoreResource.load and then debug from
>>>> there?
>>>>
>>>> With defined queries the execution path should:
>>>> StoreResource.load
>>>> HibernateResource.loadResource
>>>> HibernateResource.loadFromStore
>>>> HibernateResource.loadUsingDefinedQueries
>>>>
>>>> The HibernateResource.loadResource method logs the message "Loading
>>>> resource:...", as I don't see it in your log I am pretty sure that
>>>> you won't even get there, so where in the StoreResource.load method
>>>> does it stop/go away? Do you get into the StoreResource.load method
>>>> at all?
>>>>
>>>> gr. Martin
>>>>
>>>> Yigal wrote:
>>>>> Martin,
>>>>> When I debug I did not get into any method called
>>>>> loadUsingDefinedQueries ().
>>>>> I'm attaching the log4j part that shows there is no activity.
>>>>> This query should return 3 lines and I get nothing.
>>>>>
>>>>> Thanks
>>>>> Yigal
>>>>>
>>>>> Martin Taal wrote:
>>>>>> Hi Yigal,
>>>>>> During debugging did you end up in the
>>>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>>>> query is correct and it returns an empty list then the issue is
>>>>>> related to hibernate (or your database is empty).
>>>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Yigal wrote:
>>>>>>> I was using up till now the TENEO build from September 2007.
>>>>>>> I wanted to take advantage of the latest fixes and loaded the
>>>>>>> TENEO I200804102324 build.
>>>>>>> With this build my queries do not execute any more.
>>>>>>> Here is my code:
>>>>>>>
>>>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>>>> "hibernate", new HibernateResourceFactory() {
>>>>>>> @Override
>>>>>>> public Resource createResource(URI uri) {
>>>>>>> return new HibernateResource(uri);
>>>>>>> }
>>>>>>> });
>>>>>>>
>>>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>>>> resourceSet.createResource (queryURI);
>>>>>>>
>>>>>>> This used to work fine and return all the entries in the table
>>>>>>> "part".
>>>>>>>
>>>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>>>> trough the code but code not find where it fails. It just create
>>>>>>> a new HibernateResource but has not data.
>>>>>>>
>>>>>>> Any help? What is the difference?
>>>>>>>
>>>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>>>> Do I need to regenerate the classes from the eCore or can I use
>>>>>>> the code that I have (EMF 2.3.1)
>>>>>>>
>>>>>>> Thanks
>>>>>>> Yigal
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616239 is a reply to message #118027] |
Sun, 13 April 2008 04:48  |
Eclipse User |
|
|
|
Hi Yigal,
During debugging did you end up in the HibernateResource.loadUsingDefinedQueries method? If so and
the query is correct and it returns an empty list then the issue is related to hibernate (or your
database is empty).
Did you enable hibernate logging? See here for an example log4j file:
http://www.elver.org/hibernate/troubleshooting.html#runtime
gr. Martin
Yigal wrote:
> I was using up till now the TENEO build from September 2007.
> I wanted to take advantage of the latest fixes and loaded the TENEO
> I200804102324 build.
> With this build my queries do not execute any more.
> Here is my code:
>
> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
> "hibernate", new HibernateResourceFactory() {
> @Override
> public Resource createResource(URI uri) {
> return new HibernateResource(uri);
> }
> });
>
> String queryStr = "hibernate://?dsname=my_database?query1=from part"
> URI queryURI = URI.createURI(queryStr); Resource r1 =
> resourceSet.createResource (queryURI);
>
> This used to work fine and return all the entries in the table "part".
>
> Withe the new version of TENEO, I get an empty list. I debug trough the
> code but code not find where it fails. It just create a new
> HibernateResource but has not data.
>
> Any help? What is the difference?
>
> I also loaded the latest EMF M200803121150 and no difference.
> Do I need to regenerate the classes from the eCore or can I use the code
> that I have (EMF 2.3.1)
>
> Thanks
> Yigal
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616243 is a reply to message #118040] |
Sun, 13 April 2008 08:46  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060709030509030005060706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Martin,
I never got into a method loadUsingDefinedQueries(). I had logging
turned on and have nothing coming into the log.
I used your log4j.properties (Even thou mine looked the same) and
attaching the result of query that should return 3 rows.
As you see in the log, nothing happens.
Yigal
Martin Taal wrote:
> Hi Yigal,
> During debugging did you end up in the
> HibernateResource.loadUsingDefinedQueries method? If so and the query is
> correct and it returns an empty list then the issue is related to
> hibernate (or your database is empty).
> Did you enable hibernate logging? See here for an example log4j file:
> http://www.elver.org/hibernate/troubleshooting.html#runtime
>
> gr. Martin
>
> Yigal wrote:
>> I was using up till now the TENEO build from September 2007.
>> I wanted to take advantage of the latest fixes and loaded the TENEO
>> I200804102324 build.
>> With this build my queries do not execute any more.
>> Here is my code:
>>
>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>> "hibernate", new HibernateResourceFactory() {
>> @Override
>> public Resource createResource(URI uri) {
>> return new HibernateResource(uri);
>> }
>> });
>>
>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>> resourceSet.createResource (queryURI);
>>
>> This used to work fine and return all the entries in the table "part".
>>
>> Withe the new version of TENEO, I get an empty list. I debug trough
>> the code but code not find where it fails. It just create a new
>> HibernateResource but has not data.
>>
>> Any help? What is the difference?
>>
>> I also loaded the latest EMF M200803121150 and no difference.
>> Do I need to regenerate the classes from the eCore or can I use the
>> code that I have (EMF 2.3.1)
>>
>> Thanks
>> Yigal
>
>
--------------060709030509030005060706
Content-Type: text/plain;
name="my.log"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="my.log"
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Created org.eclipse.emf.teneo.hibernate.resource.HibernateResource using uri: hibernate://?dsname=yigal_db&query1=from Border
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Initialized contents member
77360 [main] DEBUG org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Creating hibernateresource using uri: hibernate://?dsname=yigal_db&query1=from Border
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Setting defined queries of resource hibernate://?dsname=yigal_db&query1=from Border/org.eclipse.emf.teneo.hibernate.resource.HibernateRes ource
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Adding query: from Border
77360 [main] DEBUG org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Using emf data store using yigal_db
--------------060709030509030005060706--
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616245 is a reply to message #118065] |
Sun, 13 April 2008 08:51  |
Eclipse User |
|
|
|
Hi Yigal,
Can you put a breakpoint in the HibernateResource.loadResource method? From there you can debug, the
system should go into the loadFromStore method and then into the loadUsingDefinedQueries method (if
there are defined queries in your uri). If you debug this, do you see that a query is executed? Or
what do you see when you debug through the load process?
The log shows that Teneo sees that you want to load using a query.
gr. Martin
Yigal wrote:
> Hi Martin,
> I never got into a method loadUsingDefinedQueries(). I had logging
> turned on and have nothing coming into the log.
> I used your log4j.properties (Even thou mine looked the same) and
> attaching the result of query that should return 3 rows.
> As you see in the log, nothing happens.
>
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> During debugging did you end up in the
>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>> is correct and it returns an empty list then the issue is related to
>> hibernate (or your database is empty).
>> Did you enable hibernate logging? See here for an example log4j file:
>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> I was using up till now the TENEO build from September 2007.
>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>> I200804102324 build.
>>> With this build my queries do not execute any more.
>>> Here is my code:
>>>
>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>> "hibernate", new HibernateResourceFactory() {
>>> @Override
>>> public Resource createResource(URI uri) {
>>> return new HibernateResource(uri);
>>> }
>>> });
>>>
>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>> resourceSet.createResource (queryURI);
>>>
>>> This used to work fine and return all the entries in the table "part".
>>>
>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>> the code but code not find where it fails. It just create a new
>>> HibernateResource but has not data.
>>>
>>> Any help? What is the difference?
>>>
>>> I also loaded the latest EMF M200803121150 and no difference.
>>> Do I need to regenerate the classes from the eCore or can I use the
>>> code that I have (EMF 2.3.1)
>>>
>>> Thanks
>>> Yigal
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616247 is a reply to message #118040] |
Sun, 13 April 2008 09:19  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020300040204050202090000
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Martin,
When I debug I did not get into any method called
loadUsingDefinedQueries ().
I'm attaching the log4j part that shows there is no activity.
This query should return 3 lines and I get nothing.
Thanks
Yigal
Martin Taal wrote:
> Hi Yigal,
> During debugging did you end up in the
> HibernateResource.loadUsingDefinedQueries method? If so and the query is
> correct and it returns an empty list then the issue is related to
> hibernate (or your database is empty).
> Did you enable hibernate logging? See here for an example log4j file:
> http://www.elver.org/hibernate/troubleshooting.html#runtime
>
> gr. Martin
>
> Yigal wrote:
>> I was using up till now the TENEO build from September 2007.
>> I wanted to take advantage of the latest fixes and loaded the TENEO
>> I200804102324 build.
>> With this build my queries do not execute any more.
>> Here is my code:
>>
>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>> "hibernate", new HibernateResourceFactory() {
>> @Override
>> public Resource createResource(URI uri) {
>> return new HibernateResource(uri);
>> }
>> });
>>
>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>> resourceSet.createResource (queryURI);
>>
>> This used to work fine and return all the entries in the table "part".
>>
>> Withe the new version of TENEO, I get an empty list. I debug trough
>> the code but code not find where it fails. It just create a new
>> HibernateResource but has not data.
>>
>> Any help? What is the difference?
>>
>> I also loaded the latest EMF M200803121150 and no difference.
>> Do I need to regenerate the classes from the eCore or can I use the
>> code that I have (EMF 2.3.1)
>>
>> Thanks
>> Yigal
>
>
--------------020300040204050202090000
Content-Type: text/plain;
name="my.log"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="my.log"
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Created org.eclipse.emf.teneo.hibernate.resource.HibernateResource using uri: hibernate://?dsname=yigal_db&query1=from Border
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Initialized contents member
77360 [main] DEBUG org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Creating hibernateresource using uri: hibernate://?dsname=yigal_db&query1=from Border
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Setting defined queries of resource hibernate://?dsname=yigal_db&query1=from Border/org.eclipse.emf.teneo.hibernate.resource.HibernateRes ource
77360 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Adding query: from Border
77360 [main] DEBUG org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Using emf data store using yigal_db
--------------020300040204050202090000--
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616249 is a reply to message #118087] |
Sun, 13 April 2008 09:30  |
Eclipse User |
|
|
|
Hi Yigal,
Yes I understand, but I am interested to know where the load process then ends up. Just knowing that
you did not get into the loadUsingDefinedQueries method does not give me enough info I am afraid.
Can you put a breakpoint in StoreResource.load and then debug from there?
With defined queries the execution path should:
StoreResource.load
HibernateResource.loadResource
HibernateResource.loadFromStore
HibernateResource.loadUsingDefinedQueries
The HibernateResource.loadResource method logs the message "Loading resource:...", as I don't see it
in your log I am pretty sure that you won't even get there, so where in the StoreResource.load
method does it stop/go away? Do you get into the StoreResource.load method at all?
gr. Martin
Yigal wrote:
> Martin,
> When I debug I did not get into any method called
> loadUsingDefinedQueries ().
> I'm attaching the log4j part that shows there is no activity.
> This query should return 3 lines and I get nothing.
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> During debugging did you end up in the
>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>> is correct and it returns an empty list then the issue is related to
>> hibernate (or your database is empty).
>> Did you enable hibernate logging? See here for an example log4j file:
>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> I was using up till now the TENEO build from September 2007.
>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>> I200804102324 build.
>>> With this build my queries do not execute any more.
>>> Here is my code:
>>>
>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>> "hibernate", new HibernateResourceFactory() {
>>> @Override
>>> public Resource createResource(URI uri) {
>>> return new HibernateResource(uri);
>>> }
>>> });
>>>
>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>> resourceSet.createResource (queryURI);
>>>
>>> This used to work fine and return all the entries in the table "part".
>>>
>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>> the code but code not find where it fails. It just create a new
>>> HibernateResource but has not data.
>>>
>>> Any help? What is the difference?
>>>
>>> I also loaded the latest EMF M200803121150 and no difference.
>>> Do I need to regenerate the classes from the eCore or can I use the
>>> code that I have (EMF 2.3.1)
>>>
>>> Thanks
>>> Yigal
>>
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616291 is a reply to message #118097] |
Mon, 14 April 2008 13:26  |
Eclipse User |
|
|
|
Martin,
I did set the brake points as you indicated and I never got to any of them.
As I said before nothing is happening and I do not understand it. It
work with the September release of TENEO but not with the current one.
Any changes in the code that I need to look at and maybe add to my code
to make it work again?
Thanks
Yigal
Martin Taal wrote:
> Hi Yigal,
> Yes I understand, but I am interested to know where the load process
> then ends up. Just knowing that you did not get into the
> loadUsingDefinedQueries method does not give me enough info I am afraid.
>
> Can you put a breakpoint in StoreResource.load and then debug from there?
>
> With defined queries the execution path should:
> StoreResource.load
> HibernateResource.loadResource
> HibernateResource.loadFromStore
> HibernateResource.loadUsingDefinedQueries
>
> The HibernateResource.loadResource method logs the message "Loading
> resource:...", as I don't see it in your log I am pretty sure that you
> won't even get there, so where in the StoreResource.load method does it
> stop/go away? Do you get into the StoreResource.load method at all?
>
> gr. Martin
>
> Yigal wrote:
>> Martin,
>> When I debug I did not get into any method called
>> loadUsingDefinedQueries ().
>> I'm attaching the log4j part that shows there is no activity.
>> This query should return 3 lines and I get nothing.
>>
>> Thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> During debugging did you end up in the
>>> HibernateResource.loadUsingDefinedQueries method? If so and the query
>>> is correct and it returns an empty list then the issue is related to
>>> hibernate (or your database is empty).
>>> Did you enable hibernate logging? See here for an example log4j file:
>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> I was using up till now the TENEO build from September 2007.
>>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>>> I200804102324 build.
>>>> With this build my queries do not execute any more.
>>>> Here is my code:
>>>>
>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>> "hibernate", new HibernateResourceFactory() {
>>>> @Override
>>>> public Resource createResource(URI uri) {
>>>> return new HibernateResource(uri);
>>>> }
>>>> });
>>>>
>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>> resourceSet.createResource (queryURI);
>>>>
>>>> This used to work fine and return all the entries in the table "part".
>>>>
>>>> Withe the new version of TENEO, I get an empty list. I debug trough
>>>> the code but code not find where it fails. It just create a new
>>>> HibernateResource but has not data.
>>>>
>>>> Any help? What is the difference?
>>>>
>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>> Do I need to regenerate the classes from the eCore or can I use the
>>>> code that I have (EMF 2.3.1)
>>>>
>>>> Thanks
>>>> Yigal
>>>
>>>
>>
>
>
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616293 is a reply to message #118315] |
Mon, 14 April 2008 13:52  |
Eclipse User |
|
|
|
Hi Yigal,
Hmm something I thought of, a change since the september release is that you have to explicitly call
load on a resource. Before this was done automatically when calling getcontents.
Do you call load somewhere explicitly?
gr. Martin
Yigal wrote:
> Martin,
> I did set the brake points as you indicated and I never got to any of them.
> As I said before nothing is happening and I do not understand it. It
> work with the September release of TENEO but not with the current one.
> Any changes in the code that I need to look at and maybe add to my code
> to make it work again?
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> Yes I understand, but I am interested to know where the load process
>> then ends up. Just knowing that you did not get into the
>> loadUsingDefinedQueries method does not give me enough info I am afraid.
>>
>> Can you put a breakpoint in StoreResource.load and then debug from there?
>>
>> With defined queries the execution path should:
>> StoreResource.load
>> HibernateResource.loadResource
>> HibernateResource.loadFromStore
>> HibernateResource.loadUsingDefinedQueries
>>
>> The HibernateResource.loadResource method logs the message "Loading
>> resource:...", as I don't see it in your log I am pretty sure that you
>> won't even get there, so where in the StoreResource.load method does
>> it stop/go away? Do you get into the StoreResource.load method at all?
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> Martin,
>>> When I debug I did not get into any method called
>>> loadUsingDefinedQueries ().
>>> I'm attaching the log4j part that shows there is no activity.
>>> This query should return 3 lines and I get nothing.
>>>
>>> Thanks
>>> Yigal
>>>
>>> Martin Taal wrote:
>>>> Hi Yigal,
>>>> During debugging did you end up in the
>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>> query is correct and it returns an empty list then the issue is
>>>> related to hibernate (or your database is empty).
>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>
>>>> gr. Martin
>>>>
>>>> Yigal wrote:
>>>>> I was using up till now the TENEO build from September 2007.
>>>>> I wanted to take advantage of the latest fixes and loaded the TENEO
>>>>> I200804102324 build.
>>>>> With this build my queries do not execute any more.
>>>>> Here is my code:
>>>>>
>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>> "hibernate", new HibernateResourceFactory() {
>>>>> @Override
>>>>> public Resource createResource(URI uri) {
>>>>> return new HibernateResource(uri);
>>>>> }
>>>>> });
>>>>>
>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>> resourceSet.createResource (queryURI);
>>>>>
>>>>> This used to work fine and return all the entries in the table "part".
>>>>>
>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>> trough the code but code not find where it fails. It just create a
>>>>> new HibernateResource but has not data.
>>>>>
>>>>> Any help? What is the difference?
>>>>>
>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>> Do I need to regenerate the classes from the eCore or can I use the
>>>>> code that I have (EMF 2.3.1)
>>>>>
>>>>> Thanks
>>>>> Yigal
>>>>
>>>>
>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616296 is a reply to message #118324] |
Mon, 14 April 2008 14:25  |
Eclipse User |
|
|
|
Hi Martin,
As you can see from the code below, I do not call "load" explicitly.
That what I was missing. I added the load() and it works.
What are the option to pass to the load(), do you a document explaining it?
Thanks
Yigal
Martin Taal wrote:
> Hi Yigal,
> Hmm something I thought of, a change since the september release is that
> you have to explicitly call load on a resource. Before this was done
> automatically when calling getcontents.
>
> Do you call load somewhere explicitly?
>
> gr. Martin
>
> Yigal wrote:
>> Martin,
>> I did set the brake points as you indicated and I never got to any of
>> them.
>> As I said before nothing is happening and I do not understand it. It
>> work with the September release of TENEO but not with the current one.
>> Any changes in the code that I need to look at and maybe add to my
>> code to make it work again?
>>
>> Thanks
>> Yigal
>>
>> Martin Taal wrote:
>>> Hi Yigal,
>>> Yes I understand, but I am interested to know where the load process
>>> then ends up. Just knowing that you did not get into the
>>> loadUsingDefinedQueries method does not give me enough info I am afraid.
>>>
>>> Can you put a breakpoint in StoreResource.load and then debug from
>>> there?
>>>
>>> With defined queries the execution path should:
>>> StoreResource.load
>>> HibernateResource.loadResource
>>> HibernateResource.loadFromStore
>>> HibernateResource.loadUsingDefinedQueries
>>>
>>> The HibernateResource.loadResource method logs the message "Loading
>>> resource:...", as I don't see it in your log I am pretty sure that
>>> you won't even get there, so where in the StoreResource.load method
>>> does it stop/go away? Do you get into the StoreResource.load method
>>> at all?
>>>
>>> gr. Martin
>>>
>>> Yigal wrote:
>>>> Martin,
>>>> When I debug I did not get into any method called
>>>> loadUsingDefinedQueries ().
>>>> I'm attaching the log4j part that shows there is no activity.
>>>> This query should return 3 lines and I get nothing.
>>>>
>>>> Thanks
>>>> Yigal
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Yigal,
>>>>> During debugging did you end up in the
>>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>>> query is correct and it returns an empty list then the issue is
>>>>> related to hibernate (or your database is empty).
>>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Yigal wrote:
>>>>>> I was using up till now the TENEO build from September 2007.
>>>>>> I wanted to take advantage of the latest fixes and loaded the
>>>>>> TENEO I200804102324 build.
>>>>>> With this build my queries do not execute any more.
>>>>>> Here is my code:
>>>>>>
>>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>>> "hibernate", new HibernateResourceFactory() {
>>>>>> @Override
>>>>>> public Resource createResource(URI uri) {
>>>>>> return new HibernateResource(uri);
>>>>>> }
>>>>>> });
>>>>>>
>>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>>> resourceSet.createResource (queryURI);
>>>>>>
>>>>>> This used to work fine and return all the entries in the table
>>>>>> "part".
>>>>>>
>>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>>> trough the code but code not find where it fails. It just create
>>>>>> a new HibernateResource but has not data.
>>>>>>
>>>>>> Any help? What is the difference?
>>>>>>
>>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>>> Do I need to regenerate the classes from the eCore or can I use
>>>>>> the code that I have (EMF 2.3.1)
>>>>>>
>>>>>> Thanks
>>>>>> Yigal
>>>>>
>>>>>
>>>>
>>>
>>>
>
>
|
|
|
Re: The Hibernate resource query does not work in the latest TENEO build [message #616298 is a reply to message #118342] |
Mon, 14 April 2008 14:45  |
Eclipse User |
|
|
|
Hi Yigal,
There are currently two options which can be passed:
- XMLResource.OPTION_DISABLE_NOTIFY: if set to true then no notifications are send out during load.
This option was used for the gmf integration but this is currently not required anymore for that
integration.
- LOAD_STRATEGY_PARAM: this one is described here:
http://www.elver.org/hibernate/hibernateresources.html#Load+ of+referenced+Objects
gr. Martin
Yigal wrote:
> Hi Martin,
> As you can see from the code below, I do not call "load" explicitly.
> That what I was missing. I added the load() and it works.
>
> What are the option to pass to the load(), do you a document explaining it?
>
> Thanks
> Yigal
>
> Martin Taal wrote:
>> Hi Yigal,
>> Hmm something I thought of, a change since the september release is
>> that you have to explicitly call load on a resource. Before this was
>> done automatically when calling getcontents.
>>
>> Do you call load somewhere explicitly?
>>
>> gr. Martin
>>
>> Yigal wrote:
>>> Martin,
>>> I did set the brake points as you indicated and I never got to any of
>>> them.
>>> As I said before nothing is happening and I do not understand it. It
>>> work with the September release of TENEO but not with the current one.
>>> Any changes in the code that I need to look at and maybe add to my
>>> code to make it work again?
>>>
>>> Thanks
>>> Yigal
>>>
>>> Martin Taal wrote:
>>>> Hi Yigal,
>>>> Yes I understand, but I am interested to know where the load process
>>>> then ends up. Just knowing that you did not get into the
>>>> loadUsingDefinedQueries method does not give me enough info I am
>>>> afraid.
>>>>
>>>> Can you put a breakpoint in StoreResource.load and then debug from
>>>> there?
>>>>
>>>> With defined queries the execution path should:
>>>> StoreResource.load
>>>> HibernateResource.loadResource
>>>> HibernateResource.loadFromStore
>>>> HibernateResource.loadUsingDefinedQueries
>>>>
>>>> The HibernateResource.loadResource method logs the message "Loading
>>>> resource:...", as I don't see it in your log I am pretty sure that
>>>> you won't even get there, so where in the StoreResource.load method
>>>> does it stop/go away? Do you get into the StoreResource.load method
>>>> at all?
>>>>
>>>> gr. Martin
>>>>
>>>> Yigal wrote:
>>>>> Martin,
>>>>> When I debug I did not get into any method called
>>>>> loadUsingDefinedQueries ().
>>>>> I'm attaching the log4j part that shows there is no activity.
>>>>> This query should return 3 lines and I get nothing.
>>>>>
>>>>> Thanks
>>>>> Yigal
>>>>>
>>>>> Martin Taal wrote:
>>>>>> Hi Yigal,
>>>>>> During debugging did you end up in the
>>>>>> HibernateResource.loadUsingDefinedQueries method? If so and the
>>>>>> query is correct and it returns an empty list then the issue is
>>>>>> related to hibernate (or your database is empty).
>>>>>> Did you enable hibernate logging? See here for an example log4j file:
>>>>>> http://www.elver.org/hibernate/troubleshooting.html#runtime
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Yigal wrote:
>>>>>>> I was using up till now the TENEO build from September 2007.
>>>>>>> I wanted to take advantage of the latest fixes and loaded the
>>>>>>> TENEO I200804102324 build.
>>>>>>> With this build my queries do not execute any more.
>>>>>>> Here is my code:
>>>>>>>
>>>>>>> Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap() .put(
>>>>>>> "hibernate", new HibernateResourceFactory() {
>>>>>>> @Override
>>>>>>> public Resource createResource(URI uri) {
>>>>>>> return new HibernateResource(uri);
>>>>>>> }
>>>>>>> });
>>>>>>>
>>>>>>> String queryStr = "hibernate://?dsname=my_database?query1=from part"
>>>>>>> URI queryURI = URI.createURI(queryStr); Resource r1 =
>>>>>>> resourceSet.createResource (queryURI);
>>>>>>>
>>>>>>> This used to work fine and return all the entries in the table
>>>>>>> "part".
>>>>>>>
>>>>>>> Withe the new version of TENEO, I get an empty list. I debug
>>>>>>> trough the code but code not find where it fails. It just create
>>>>>>> a new HibernateResource but has not data.
>>>>>>>
>>>>>>> Any help? What is the difference?
>>>>>>>
>>>>>>> I also loaded the latest EMF M200803121150 and no difference.
>>>>>>> Do I need to regenerate the classes from the eCore or can I use
>>>>>>> the code that I have (EMF 2.3.1)
>>>>>>>
>>>>>>> Thanks
>>>>>>> Yigal
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>
>>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Tue Jul 22 13:16:15 EDT 2025
Powered by FUDForum. Page generated in 0.30657 seconds
|