Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo] Refresh ?
[Teneo] Refresh ? [message #48541] |
Tue, 05 September 2006 10: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 11: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 12:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
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 #48750 is a reply to message #48667] |
Tue, 05 September 2006 14: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 #590212 is a reply to message #48574] |
Tue, 05 September 2006 11: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 12:01 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
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 14: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
|
|
| |
Goto Forum:
Current Time: Sun Oct 06 09:32:28 GMT 2024
Powered by FUDForum. Page generated in 0.04509 seconds
|