You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by C N Davies <cn...@cndavies.com> on 2010/05/03 18:09:52 UTC

What is a NaN?

I guess it is "Not a Number",

 

But I am not inserting anything that is not a number L

 

If I have SQL trace switched on I can see select statements but I never seem
to see update or insert queries so  I can't really see what the error is in
the query.

 

Anyone have any ideas? I have processed this same data files before !

 

Thanks 

 

Chris

 

 

Caused by: <openjpa-2.0.0-r422266:935683 fatal general error>
org.apache.openjpa.persistence.PersistenceException: The transaction has
been rolled back.  See the nested exceptions for details on the errors that
occurred.

                at
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2302)

                at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2139)

                at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)

                at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1955)

                at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.jav
a:81)

                at
org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)

                at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)

                at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.ja
va:559)

                ... 5 more

Caused by: <openjpa-2.0.0-r422266:935683 fatal general error>
org.apache.openjpa.persistence.PersistenceException: 'NaN' is not a valid
numeric or approximate numeric value

                at
org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4827)

                at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java
:4787)

                at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)

                at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110)

                at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62)

                at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedSt
atementManagerImpl.java:89)

                at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdat
eManager.java:550)

                at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdat
eManager.java:106)

                at
org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(Batchin
gConstraintUpdateManager.java:59)

                at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateMan
ager.java:103)

                at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateMan
ager.java:76)

                at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:
751)

                at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManage
r.java:131)

                at
org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManag
er.java:540)

                at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManage
r.java:131)

                ... 12 more

Caused by: java.sql.SQLException: 'NaN' is not a valid numeric or
approximate numeric value

                at
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)

                at
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)

                at
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)

                at
com.mysql.jdbc.PreparedStatement.setDouble(PreparedStatement.java:3252)

                at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setDouble(Delegating
PreparedStatement.java:317)

                at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$Log
gingPreparedStatement.setDouble(LoggingConnectionDecorator.java:1229)

                at
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.setDouble(Delegating
PreparedStatement.java:317)

                at
org.apache.openjpa.jdbc.sql.DBDictionary.setDouble(DBDictionary.java:1067)

                at
org.apache.openjpa.jdbc.sql.DBDictionary.setTyped(DBDictionary.java:1243)

                at
org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:896)

                at
org.apache.openjpa.jdbc.sql.RowImpl.flush(RowImpl.java:856)

                at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(P
reparedStatementManagerImpl.java:116)

                at
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAnd
Update(BatchingPreparedStatementManagerImpl.java:81)

                at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(Pr
eparedStatementManagerImpl.java:99)

                at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedSt
atementManagerImpl.java:87)

                ... 21 more

 

 

 

 


Re: What is a NaN?

Posted by Craig L Russell <cr...@oracle.com>.
Apparently, divide by zero causes a fixed point exception but not for  
floating point.

Craig

On May 3, 2010, at 12:11 PM, C N Davies wrote:

> Thanks Richard you were right it was a  0.0 / 0.0 which I would have  
> thought
> would have generated a divide by zero exception which I do capture,  
> but
> apparently not *shrug*. Also 0 divide by zero I would have thought  
> was zero
> ... I learned 2 new things today!
>
> Thanks!
>
> Chris
>
>
> -----Original Message-----
> From: Landers, Richard [mailto:Richard.Landers@ct.gov]
> Sent: Tuesday, 4 May 2010 3:38 AM
> To: 'users@openjpa.apache.org'
> Subject: RE: What is a NaN?
>
>
> Could you have arithmetic gone bad before persisting?
>
> 	0.0 / 0.0
> 	Sqrt(-something)
> 	Inf - Inf
>
> http://www.concentric.net/~Ttwang/tech/javafloat.htm has other  
> examples.
>
>
> -----Original Message-----
> From: C N Davies [mailto:cnd@cndavies.com]
> Sent: Monday, May 03, 2010 1:05 PM
> To: users@openjpa.apache.org
> Subject: RE: What is a NaN?
>
> No, just a str8 insert :(
>
>
> -----Original Message-----
> From: Daryl Stultz [mailto:daryl@6degrees.com]
> Sent: Tuesday, 4 May 2010 2:54 AM
> To: users@openjpa.apache.org
> Subject: Re: What is a NaN?
>
> On Mon, May 3, 2010 at 12:09 PM, C N Davies <cn...@cndavies.com> wrote:
>
>> I guess it is "Not a Number",
>>
>> A long shot: do you have any JavaScript involved?
>
> -- 
> Daryl Stultz
> _____________________________________
> 6 Degrees Software and Consulting, Inc.
> http://www.6degrees.com
> mailto:daryl@6degrees.com
>
>
>
>

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@oracle.com
P.S. A good JDO? O, Gasp!


RE: What is a NaN?

Posted by C N Davies <cn...@cndavies.com>.
Thanks Richard you were right it was a  0.0 / 0.0 which I would have thought
would have generated a divide by zero exception which I do capture, but
apparently not *shrug*. Also 0 divide by zero I would have thought was zero
... I learned 2 new things today!

Thanks!

Chris


-----Original Message-----
From: Landers, Richard [mailto:Richard.Landers@ct.gov] 
Sent: Tuesday, 4 May 2010 3:38 AM
To: 'users@openjpa.apache.org'
Subject: RE: What is a NaN?


Could you have arithmetic gone bad before persisting?

	0.0 / 0.0  
	Sqrt(-something)
	Inf - Inf 

http://www.concentric.net/~Ttwang/tech/javafloat.htm has other examples.


-----Original Message-----
From: C N Davies [mailto:cnd@cndavies.com] 
Sent: Monday, May 03, 2010 1:05 PM
To: users@openjpa.apache.org
Subject: RE: What is a NaN?

No, just a str8 insert :(


-----Original Message-----
From: Daryl Stultz [mailto:daryl@6degrees.com] 
Sent: Tuesday, 4 May 2010 2:54 AM
To: users@openjpa.apache.org
Subject: Re: What is a NaN?

On Mon, May 3, 2010 at 12:09 PM, C N Davies <cn...@cndavies.com> wrote:

> I guess it is "Not a Number",
>
> A long shot: do you have any JavaScript involved?

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com





RE: What is a NaN?

Posted by "Landers, Richard" <Ri...@ct.gov>.
Could you have arithmetic gone bad before persisting?

	0.0 / 0.0  
	Sqrt(-something)
	Inf - Inf 

http://www.concentric.net/~Ttwang/tech/javafloat.htm has other examples.


-----Original Message-----
From: C N Davies [mailto:cnd@cndavies.com] 
Sent: Monday, May 03, 2010 1:05 PM
To: users@openjpa.apache.org
Subject: RE: What is a NaN?

No, just a str8 insert :(


-----Original Message-----
From: Daryl Stultz [mailto:daryl@6degrees.com] 
Sent: Tuesday, 4 May 2010 2:54 AM
To: users@openjpa.apache.org
Subject: Re: What is a NaN?

On Mon, May 3, 2010 at 12:09 PM, C N Davies <cn...@cndavies.com> wrote:

> I guess it is "Not a Number",
>
> A long shot: do you have any JavaScript involved?

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com





RE: What is a NaN?

Posted by C N Davies <cn...@cndavies.com>.
No, just a str8 insert :(


-----Original Message-----
From: Daryl Stultz [mailto:daryl@6degrees.com] 
Sent: Tuesday, 4 May 2010 2:54 AM
To: users@openjpa.apache.org
Subject: Re: What is a NaN?

On Mon, May 3, 2010 at 12:09 PM, C N Davies <cn...@cndavies.com> wrote:

> I guess it is "Not a Number",
>
> A long shot: do you have any JavaScript involved?

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com


Re: What is a NaN?

Posted by Daryl Stultz <da...@6degrees.com>.
On Mon, May 3, 2010 at 12:09 PM, C N Davies <cn...@cndavies.com> wrote:

> I guess it is "Not a Number",
>
> A long shot: do you have any JavaScript involved?

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com