I was able to get it to work by bringing in the soucre and compiling it in
with my project.  I suspect something wasn't on the classpath correctly.  I
also had to get the source for the JDO classes and compile them since I
haven't found them in the OJB distribution.  Is there a seperate
distribution for the JDO files that you know of?

Thanks for your willingness to help,
Shawn


Here is the code that was giving the problem:

        public void importFile(String pathName){
                exceptions = ExceptionList.getInstance();
                createReader(pathName);
                OjbStorePMF factory = new OjbStorePMF();
                PersistenceManager pm = factory.getPersistenceManager();
                
                pm.currentTransaction().begin();


                while(reader.nextLine()){
                        Pool newPool = getPool();
                        Identity oid = new Identity(newPool);
                                
                        logger.finest("Identity obtained: " + (oid !=
null));
                        
                        Pool existingPool = (Pool)pm.getObjectById(oid,
false);
                        logger.finest("Pool obtained: " + (existingPool !=
null));
                        if(existingPool != null){
                                logger.finest("Pool obtained: " +
existingPool.toString());
                        }
                        
                        if(existingPool == null){
                                newPool.setAddDate(new Date());
                                pm.makePersistent(newPool);
                        }
                        else {

        
existingPool.setPoolName(newPool.getPoolName());
                                existingPool.setModUser("import module");  
        
existingPool.setModDate(newPool.getModDate());
                        
                        }
                        
                }
                
                pm.currentTransaction().commit();

                
                pm.close();
        }

        protected Pool getPool(){
                Pool pool = new Pool();
                
                reader.nextField();
                pool.setPoolCode(reader.getField());
        
                reader.nextField();
                pool.setPoolName(reader.getField());
                
                pool.setModDate(new Date());

                return pool;    
        }



-----Original Message-----
From: Thomas Mahler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 10:19 AM
To: OJB Users List
Subject: Re: JDO - getObjectById()


please post the code that produces the error, indicate where the problem 
occurs. Stacktrace would be nice.

Shawn Vincent wrote:
> I am trying to duplicate the JDO example for using getObjectById() to look
> up an object.  I try to create the Identity class, but I keep getting an
> exception that there are no implementors defined for the interface
> org.apache.ojb.broker.Identity.  Can anyone help me with this?
> 
> Thanks,
> Shawn Vincent
> Technical Architect
> Sogeti-USA
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to