-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: unable to persist POJO object
PostPosted: Mon May 29, 2006 6:44 am 
Newbie

Joined: Wed Nov 09, 2005 1:45 am
Posts: 3
Hi All,

when I am trying to persist a POJO object, it is throwing exception "null". what does it mean? how do we resolve this?
I checked the status of object....it is not NULL!!!!.
when execute the statement session.save(obj); it is failing....

the flow is clike this :

1. objC aggregates to make objB
2. objB aggregates to make objA

I can able save objA and objB successfully, but when I try to save objC, it fails.....I don't understand why the error "null" is coming. If there is any error with mapping, we will get mapping errors but not "null" error.

Plz try to answer this.

Thanks in advance

--Venkat[/img]


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 9:32 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
please post debug log + stacktrace + code

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 12:46 am 
Newbie

Joined: Wed Nov 09, 2005 1:45 am
Posts: 3
Error message: null
java.lang.NullPointerException
at com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter.initializeUserParam(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.addUserParametersToRPC(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1953)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:557)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:545)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:541)
at com.ge.med.gemsit.cis.perinatal.DPS.persistance.WaveData.DAO.FetalStripDAO.storeFetalWaveData(FetalStripDAO.java:314)
at com.ge.med.gemsit.cis.perinatal.DPS.persistance.WaveData.DAO.Test.main(Test.java:15)

-----------------------------------------------------------------------------------
int storefetalWaveStatus=0;
Session session = null;
try
{
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session = sessionFactory.openSession();
Patient objPatient = (Patient) session.load(Patient.class, new Integer(patientId));
FetalStrip objFetalStrip = new FetalStrip();
objFetalStrip.setStartTime(startTime);
objFetalStrip.setFsPatient(objPatient);
org.hibernate.Transaction tranact = session.beginTransaction();
session.save(objFetalStrip);

FSWaveform objWaveform = new FSWaveform();
objWaveform.setFetalStrip(objFetalStrip);
objWaveform.setWaveform_Name("FHR1");
tranact = session.beginTransaction();
session.save(objWaveform);
FSWaveformSegment objSegment = new FSWaveformSegment();
objSegment.setStartTime(startTime);
objSegment.setWaveform(objWaveform);
objSegment.setWaveformName("FHR1");
objSegment.setPatientID(objPatient);
session.save(objSegment);
tranact.commit();
session.flush();
session.close();

}catch(Exception e){
System.out.println("Error message: " + e.getMessage());
e.printStackTrace();

}

return storefetalWaveStatus;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.