permaculture playing cards
The moose likes BEA/Weblogic and the fly likes Weblogic-QL -- Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Weblogic-QL -- Resultset" Watch "Weblogic-QL -- Resultset" New topic

Weblogic-QL -- Resultset

Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Hey All,

I have posted a similar one in EJB, but thought weblogic might be able to provide more details.

Let me explain my situation briefly.

I have two tables, ENTITY_TYPE and ENTITY. I have entity beans for both the tables and have relationships provided in the deployment descriptors. it complies fine and deploys.

Now, i need to retrieve all entity's sorted by entity types, my requirement needs information from some columns from ENTITY_TYPE also. I was trying to write some query in descriptor,but i am running into problems.

I did come across some articles that say that weblogic-QL ( instead of using EJB-QL) does support the return type to be a RESULT SET.

I just started using EJB-QL.

So, any help in this will be appreciated.

Thanks in advance .
gayathri hariharan

Joined: Jan 11, 2005
Posts: 27
Since you have a relation defined between entity and entity_type,
once you get the entities sorted by the type, you should be able to do
I was just wondering if you need to go the resultset way.

thanks,<br />Gayathri
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Thanks for your reply.

Yes, i do have relationship defined those two tables.

but if i have 100 entities, shouldnt i be invoking the home interface for getting the entity type ( actualy the data required for my logic ) within the loop. I was thinking that might not be the best approach.

Or I can get all the entity types and then get the entity for each type.

Even in that scenario, i made multiple calls and i am not sure if that is a good idea, rather i can use a DAO that might get me all the required data in a single query.

Since i was planning to cache the data, i was hoping to use entity beans ( read only ) and the chances of the data changing are very less, but still i should be handling it .

For straigh forward logic, its quite simple and efficient to implement caching in entity bean. For this one, i am not sure how to extract the data , as such.

Any help will be appreciated,
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
well, it appears from EJB 2.0, only local interfaces support relationships ( please correct me if i am wrong ). I added the code to get the collection of entities in entity type's local interface and everything seems to be fine.

All this development was done in weblogic 8.1 . I tried to deploy the same code in weblogic 6.1. Everything seems to be working fine.

I had made the entity beans to be read-only, that gets invalidated upon change, thereby forcing data to be read from database.

User the below logic to invalidate


import javax.naming.InitialContext;
import weblogic.ejb.CachingHome;

Context initial = new InitialContext();
Object o = initial.lookup("CustomerEJB_CustomerHome");
CustomerHome customerHome = (CustomerHome)o;

CachingHome customerCaching = (CachingHome)customerHome;


Invalidation works find in weblogic 8.1. When i tried to do the same thing in weblogic 6.1 , it seems to be invalidating and calls the EJB. but data still seems to be the old one, thought ejbStore and ejbload are being called.

Does weblogic 6.1 fail to support this caching invalidation ??

any help will be great.
I agree. Here's the link:
subject: Weblogic-QL -- Resultset
It's not a secret anymore!