File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes how to refresh ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to refresh ..." Watch "how to refresh ..." New topic

how to refresh ...

mihran eprem

Joined: Apr 26, 2012
Posts: 4
my problem is that i have a big database schema that is should map my entities on it
the schema contain tables and database views (the database design i cant change )
i mapped one entity in one of the database views its worked fine (of course its not updateable )
then i map another entity to a database table that related on previous database view (its updateable)
when i update the entity and merge it
the first entity still contain the old values

i cant use manual em.refresh() , because the is a lot of records (more than 25000)

any solution any idea


i tried to use em listeners ...don't work
i tried to put cascade merge ...don't work

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2068
You need to execute another call to get the view data.

Also, if caching is involved, in case the update connection and view connection uses different connections (or hibernate setups), the view call to get data should not be cached (this can be an issue you need to resolve especially if huge data is involved). If they are together (the view and update calls) in the same hibernate setup, and the view is cached, the update must refresh/clear the cache when update is called.
mihran eprem

Joined: Apr 26, 2012
Posts: 4
thank you for for your information
but there is some point that is should clarified
1-im using ejb 3
2- deploy on weblogic
3 my data base is oracle 11g
4 yes all the entities use the same database connection

can i disable the cash for on entity ???
Leslie White

Joined: Apr 28, 2012
Posts: 2

In persistence.xml try this: <shared-cache-mode>NONE</shared-cache-mode> or can be selectively enabled/disabled using the @Cache annotation on entity.

mihran eprem

Joined: Apr 26, 2012
Posts: 4
thank you
i try it and its worked so good
thank you again
I agree. Here's the link:
subject: how to refresh ...
jQuery in Action, 3rd edition