Thought inc.

The Dynamic O/R Mapping Company

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Questions
Cocobase EAServer problem.........
< Previous Thread     Next Thread >
Thread    Post New Thread     Post A Reply

Registered: Jan 2006
Posts: 1

I am getting a problem trying to use Cocobase with EAServer.
I am trying to load data from the database using a XML Map.
When I debug the message, it says it is retrieving the data and the cbFacade.load(DTO, map_name) call is successful and the object is returned. When I cast it to the same class I get an error. I checked everything on my classpath and all looks fine.

I also spotted a wierd behavior. when I do not set the primary key on my DTO, the load works fine. when I set the primary key the load fails. I have supplied the properties I use to connect to cocobase runtime.

The following is the piece of code my DAO executes.

try {
UserInfo dto = new UserInfo();
cbFacade = getFacade();

dto = (UserInfo)cbFacade.load(dto, bundleCoco.getString("USERINFO_MAP"));

If the setName is commented out then the load is a success.
else it fails.

Any thoughts?

01-05-2006 09:08 AM
Click Here to See the Profile for ranga    Find more posts by ranga        Edit/Delete Message    Reply w/Quote    IP: Logged

Registered: Apr 2001
Posts: 19

This sounds like it might be a class loading issue. When the pk is provided, the facade calls the navigator facility to build an example object out of the primary key. This example object is first instantiated out of the runtime class loader, which for CocoBase is usually the default system classloader (because CocoBase is usually deployed as a system library through the %coco_home%\demos\mk*.bat/.sh scripts). Your application, on the other hand, is probably using the app war/jar class loader to load classes, which will load a different copy of the same class file at every run. The reason it works when the pk is not used is because in that case the facade uses the qbe system, which takes the class of the object passed in rather than instantiating a new one.

It seems to us that your application classes should be deployed as system libraries rather than being deployed as classes from a particular jar or war within the ./classes folder (usually classes under the /classes folder are re-loaded every time the jar is deployed and multiple copies of those classes can exist within the server because of that). You can also
try putting those under the /lib folder in the war.

Does that make sense?


01-05-2006 12:54 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.