Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo] Refresh ?
[Teneo] Refresh ? [message #48541] |
Tue, 05 September 2006 06:24  |
Eclipse User |
|
|
|
Originally posted by: dami.dworld.org
Hello,
I used the teneo EMF Hibernate with the Library EMF Example. No problem.
However, I've done some tests :
2 Clients : A and B
If Client 'A' add a Book and Commit => Client B don't update automatically
:(
I try to hit "Refresh" and it's not any better, no update.
I'd like to find a way to update the view according to the real database
content, any simple solution ?
Thank you
|
|
| |
Re: [Teneo] Refresh ? [message #48604 is a reply to message #48574] |
Tue, 05 September 2006 07:18   |
Eclipse User |
|
|
|
Originally posted by: dami.dworld.org
"Martin Taal" <mtaal@elver.org>
> Dami,
> I am not sure why the refresh action does not update the information. When
> you look at the log (log4j) do you see that the system actually connects
> to the database and does queries?
I've done some additional tests, to be clear, I'm using the Editor generated
by EMF. When I run the editor, it displays my model as a TREE with node.
With the Library example, I have "Library" Which included "Writer" and
"Book". When I hit the contextual menu "Refresh" on the Library element,
nothing happend. No move in the log4j. However, if I select a Writer and
that I do the exact same thing, I see the Log4j moving (connecting, etc.)
but the Writer is not updated according with the database last changed (I
renamed the writer with another client).
> Client notification/broadcast when something changes in the database is
> not supported by Teneo. You can also look at CDO (another EMFT project)
> which supports client notifications/broadcast in combination with a
> persistence solution.
Ok, but a manually refresh will do the work :p I need to make it work.
> gr. Martin
>
|
|
|
Re: [Teneo] Refresh ? [message #48667 is a reply to message #48604] |
Tue, 05 September 2006 08:01   |
Eclipse User |
|
|
|
Hi Dami,
Assume you know which object changed then you should try something like this:
EObject object = resource.getEObject(obj.getUriFragment());
HibernateResource hbResource = (HibernateResource)resource;
hbResource.getSession().refresh(object);
This post on the elver mailing list can also be of interest:
http://article.gmane.org/gmane.comp.java.emf.persistency/287
gr. Martin
dami wrote:
> "Martin Taal" <mtaal@elver.org>
>> Dami,
>> I am not sure why the refresh action does not update the information. When
>> you look at the log (log4j) do you see that the system actually connects
>> to the database and does queries?
>
> I've done some additional tests, to be clear, I'm using the Editor generated
> by EMF. When I run the editor, it displays my model as a TREE with node.
> With the Library example, I have "Library" Which included "Writer" and
> "Book". When I hit the contextual menu "Refresh" on the Library element,
> nothing happend. No move in the log4j. However, if I select a Writer and
> that I do the exact same thing, I see the Log4j moving (connecting, etc.)
> but the Writer is not updated according with the database last changed (I
> renamed the writer with another client).
>
>
>> Client notification/broadcast when something changes in the database is
>> not supported by Teneo. You can also look at CDO (another EMFT project)
>> which supports client notifications/broadcast in combination with a
>> persistence solution.
>
> Ok, but a manually refresh will do the work :p I need to make it work.
>
>> gr. Martin
>>
>
>
--
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: [Teneo] Refresh ? [message #48807 is a reply to message #48750] |
Wed, 06 September 2006 03:20  |
Eclipse User |
|
|
|
I do not know that much of the emf editor part but my guess would be in the refreshViewerAction
which should be somewhere in the generated editor project in the ActionBarContributor.
Otherwise you should ask on the emf newsgroup.
You also have to take into account the following:
In the elver mailinglist post you can see that they used notifications to determine which object was
changed, only that object was refreshed. In your case I am not sure if you know which object has
changed. This means that you have to refresh each object in the hibernateresource. If you do that
(using the getContents method on the resource) you will also load all lazily loaded lists. This can
be undesirable behavior (depending on the size of the database).
So it would be best if I add a refresh method to the hibernate resource which considers lazily
loaded lists (and does not load them). Let me know if this would be helpfull and that (if possible)
you can test it out (if you are on the cvs version).
gr. Martin
dami wrote:
> "Martin Taal" <mtaal@elver.org>
>> Hi Dami,
>> Assume you know which object changed then you should try something like
>> this:
>> EObject object = resource.getEObject(obj.getUriFragment());
>> HibernateResource hbResource = (HibernateResource)resource;
>> hbResource.getSession().refresh(object);
>>
>> This post on the elver mailing list can also be of interest:
>> http://article.gmane.org/gmane.comp.java.emf.persistency/287
>>
>
> Thanks again for your help !
>
> Where should I insert this code ? I want to be able to manually refresh
> whenever I need it with the editor plugin.
>
--
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: [Teneo] Refresh ? [message #590201 is a reply to message #48541] |
Tue, 05 September 2006 06:44  |
Eclipse User |
|
|
|
Dami,
I am not sure why the refresh action does not update the information. When you look at the log
(log4j) do you see that the system actually connects to the database and does queries?
Client notification/broadcast when something changes in the database is not supported by Teneo. You
can also look at CDO (another EMFT project) which supports client notifications/broadcast in
combination with a persistence solution.
gr. Martin
dami wrote:
> Hello,
>
> I used the teneo EMF Hibernate with the Library EMF Example. No problem.
> However, I've done some tests :
>
> 2 Clients : A and B
>
> If Client 'A' add a Book and Commit => Client B don't update automatically
> :(
> I try to hit "Refresh" and it's not any better, no update.
>
> I'd like to find a way to update the view according to the real database
> content, any simple solution ?
>
> Thank you
>
>
--
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: [Teneo] Refresh ? [message #590212 is a reply to message #48574] |
Tue, 05 September 2006 07:18  |
Eclipse User |
|
|
|
Originally posted by: dami.dworld.org
"Martin Taal" <mtaal@elver.org>
> Dami,
> I am not sure why the refresh action does not update the information. When
> you look at the log (log4j) do you see that the system actually connects
> to the database and does queries?
I've done some additional tests, to be clear, I'm using the Editor generated
by EMF. When I run the editor, it displays my model as a TREE with node.
With the Library example, I have "Library" Which included "Writer" and
"Book". When I hit the contextual menu "Refresh" on the Library element,
nothing happend. No move in the log4j. However, if I select a Writer and
that I do the exact same thing, I see the Log4j moving (connecting, etc.)
but the Writer is not updated according with the database last changed (I
renamed the writer with another client).
> Client notification/broadcast when something changes in the database is
> not supported by Teneo. You can also look at CDO (another EMFT project)
> which supports client notifications/broadcast in combination with a
> persistence solution.
Ok, but a manually refresh will do the work :p I need to make it work.
> gr. Martin
>
|
|
|
Re: [Teneo] Refresh ? [message #590227 is a reply to message #48604] |
Tue, 05 September 2006 08:01  |
Eclipse User |
|
|
|
Hi Dami,
Assume you know which object changed then you should try something like this:
EObject object = resource.getEObject(obj.getUriFragment());
HibernateResource hbResource = (HibernateResource)resource;
hbResource.getSession().refresh(object);
This post on the elver mailing list can also be of interest:
http://article.gmane.org/gmane.comp.java.emf.persistency/287
gr. Martin
dami wrote:
> "Martin Taal" <mtaal@elver.org>
>> Dami,
>> I am not sure why the refresh action does not update the information. When
>> you look at the log (log4j) do you see that the system actually connects
>> to the database and does queries?
>
> I've done some additional tests, to be clear, I'm using the Editor generated
> by EMF. When I run the editor, it displays my model as a TREE with node.
> With the Library example, I have "Library" Which included "Writer" and
> "Book". When I hit the contextual menu "Refresh" on the Library element,
> nothing happend. No move in the log4j. However, if I select a Writer and
> that I do the exact same thing, I see the Log4j moving (connecting, etc.)
> but the Writer is not updated according with the database last changed (I
> renamed the writer with another client).
>
>
>> Client notification/broadcast when something changes in the database is
>> not supported by Teneo. You can also look at CDO (another EMFT project)
>> which supports client notifications/broadcast in combination with a
>> persistence solution.
>
> Ok, but a manually refresh will do the work :p I need to make it work.
>
>> gr. Martin
>>
>
>
--
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: [Teneo] Refresh ? [message #590264 is a reply to message #48667] |
Tue, 05 September 2006 10:03  |
Eclipse User |
|
|
|
Originally posted by: dami.dworld.org
"Martin Taal" <mtaal@elver.org>
> Hi Dami,
> Assume you know which object changed then you should try something like
> this:
> EObject object = resource.getEObject(obj.getUriFragment());
> HibernateResource hbResource = (HibernateResource)resource;
> hbResource.getSession().refresh(object);
>
> This post on the elver mailing list can also be of interest:
> http://article.gmane.org/gmane.comp.java.emf.persistency/287
>
Thanks again for your help !
Where should I insert this code ? I want to be able to manually refresh
whenever I need it with the editor plugin.
--
dami
|
|
|
Re: [Teneo] Refresh ? [message #590290 is a reply to message #48750] |
Wed, 06 September 2006 03:20  |
Eclipse User |
|
|
|
I do not know that much of the emf editor part but my guess would be in the refreshViewerAction
which should be somewhere in the generated editor project in the ActionBarContributor.
Otherwise you should ask on the emf newsgroup.
You also have to take into account the following:
In the elver mailinglist post you can see that they used notifications to determine which object was
changed, only that object was refreshed. In your case I am not sure if you know which object has
changed. This means that you have to refresh each object in the hibernateresource. If you do that
(using the getContents method on the resource) you will also load all lazily loaded lists. This can
be undesirable behavior (depending on the size of the database).
So it would be best if I add a refresh method to the hibernate resource which considers lazily
loaded lists (and does not load them). Let me know if this would be helpfull and that (if possible)
you can test it out (if you are on the cvs version).
gr. Martin
dami wrote:
> "Martin Taal" <mtaal@elver.org>
>> Hi Dami,
>> Assume you know which object changed then you should try something like
>> this:
>> EObject object = resource.getEObject(obj.getUriFragment());
>> HibernateResource hbResource = (HibernateResource)resource;
>> hbResource.getSession().refresh(object);
>>
>> This post on the elver mailing list can also be of interest:
>> http://article.gmane.org/gmane.comp.java.emf.persistency/287
>>
>
> Thanks again for your help !
>
> Where should I insert this code ? I want to be able to manually refresh
> whenever I need it with the editor plugin.
>
--
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 May 06 17:17:54 EDT 2025
Powered by FUDForum. Page generated in 0.04653 seconds
|