Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!

Vishwas T Prasanna

Greenhorn
+ Follow
since Jan 18, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vishwas T Prasanna

haeee it worked... i changed the driver from ojdbc14.jar to classes12.jar.. and its working.

Thanks a lot... With out u i would have wasted another week ...
I am working on the comments sent by u.

This is information u asked
jdbc driver racle JDBC Driver version - 9.0.2.0.0
oracle version :
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
driver class is oracle.jdbc.driver.OracleDriver
I am using net.sf.hibernate.dialect.Oracle9Dialect dialect
and jdbc driver ojdbc14.jar.
The query
select USER_SESSIONS_SEQ.nextval from dual;
result is proper..

I am using "private Integer id;" in userSessionsBO .

This is code which is saving the userSessionsBO

1. serviceImpl.beginTransaction();
2. sessionBO.setCreatedOn(new Date());
3. sessionBO.setCreatedBy(personBO.getAccountName());
4. serviceImpl.getSession().save(sessionBO);
5. serviceImpl.commitTransaction();

at line 1 i checked that id is null and then i put a break point at line 4 and checked the id value after save. It is same value from the query " select USER_SESSIONS_SEQ.nextval from dual; " but after committing when i check in the database the id value is different.
when i save the object and see in the oracle 9i database the id column has these values.. ( 9.900E+123 , -0.370E-28 ) . I am using a oracle sequence (1- 999999999...), and the current sequence value in the database in 345.
Hibernate mapping for id column is as given below..

<class name="userSessionBO" table="USER_SESSIONS" dynamic-update="true" dynamic-insert="true" select-before-update="true">

<id name="id" column="id" type="integer" unsaved-value="null">
<generator class="sequence">
<param name="sequence">USER_SESSIONS_SEQ</param>
</generator>
</id>
....

</calss>
HIbernate is generating some junk values for the id property plz, can some one help me to sort it out..
I am using oracle sequence for generating for values for the id property and my mapping is as given below..

<id name="id" column="id" type="integer" unsaved-value="null">
<generator class="sequence">
<param name="sequence">USER_SESSIONS_SEQ</param>
</generator>
</id>

but when when i save the object, hibernate is saving -E.000E-78 this kind of values into the table..

Plz Plz can any body help me...