users@glassfish.java.net

RE: JPA

From: Kenneth Clark <kenneth_at_rabiddog.co.za>
Date: Wed, 6 Jun 2007 07:12:29 +0200

I don't know what I did but I must have done something wrong during the
creation process because when I started from scratch it all worked.

Sorry about hassling everyone and thanks for the feed back

Kenneth Clark
System Architect / Lead Developer

Rabid Dog Laboratories T
Putting the art back into development

tel: +27 11 475 7409
mobile: +27 82 500 5090
e-mail: kenneth_at_rabiddog.co.za
website: http://www.rabiddog.co.za/
-----Original Message-----
From: Markus.Fuchs_at_Sun.COM [mailto:Markus.Fuchs_at_Sun.COM]
Sent: 05 June 2007 21:53
To: users_at_glassfish.dev.java.net
Subject: Re: JPA

Hi Daniel,

External changes should be visible in transactions starting after the
external change committed. The cache can be disabled for queries by a
query hint:

    // named query is SELECT p FROM Person p
    final Query q = this.entityManager.createNamedQuery("findEverybody");
    assert q != null;
    q.setHint("toplink.cache-usage", 0); // JDK 1.5; this works
    final List list = q.getResultList(); // List of Person entities

Please also check the EntityManager's refresh API for usage on persistent
instances.

Regards,

-- markus.



Daniel Cavalcanti wrote:
> Very basic question:
> I have an app that I use JPA to access a MySQL database.
> When I add rows into a table using MySQL utilities, I don't see them
> im my application when I use the entity manager. I know TopLink uses
> cache, so how do I make it refresh so that I can get the added rows...
>
> thanks,
> Daniel.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net




-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.472 / Virus Database: 269.8.9/832 - Release Date: 04/06/2007
18:43