Re: Re: Strange behaviour @ postgres

Franck Routier <[email protected]> Fri, 21 May 2010 17:15:32 +0200
Newsgroups gmane.comp.java.orm.simpleorm
Organization Axège sarl
Message-ID <1274454932.2405.33.camel@franck-laptop>
Hi,


Le vendredi 21 mai 2010 à 13:31 +0000, dreysfy a écrit :
> 
> fieldValues actually contain the Jdbc3Array object with a string value
> representing an array.

Then that's why you get into trouble when trying to use this object
offline. This implementation tries to talk to the db...

>  The Jdbc standard also say that the array object of a field have to
> be the java.sql.Array.
> 
We get into the same kind of problem with Timestamp and Oracle jdbc
drivers. On getObject(), they return the driver's internal object, not
java.sql.Timestamp.

I'm not sure what the spec says, but I think it is :

- getArray() must return java.sql.Array
- but getObject() can return any Object, be it a driver specific
implementation...

> The main issue is however, that to perform a getArray() method a
> connection have to be open. Or the getArray() method was called when a
> connection was open and in that case the array was cached within the
> Array implementation. (see commented code)
> 
Yes. This is a problem with Postgresql jdbc driver. A workaround would
be to access the string representation of the array in Jdbc3Array and to
turn it into Integer[] in your own getArray() method.

> There is a workaround, where you call the getArray() method after
> ses.query(query) not closing the connection. But imho its somewhat
> misleading.

Yes, but I don't think there is anything that can be done in Simpelorm
about this :-(


Regards
Franck






------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/