Re: Timestamps and PostgreSQL

2010-12-05 Thread Paul Hoadley
On 05/12/2010, at 8:08 PM, Paul Hoadley wrote:

> EOF calls PreparedStatement.setTimestamp(int, Timestamp) (implemented in 
> AbstractJdbc2Statement), which in turn calls 
> PreparedStatement.setTimestamp(int, Timestamp, Calendar) with a null Calendar.

Just for completeness, that's not quite true.  Ramsey pointed out that 
JDBCColumn.takeInputValue() calls setObject() on that class.  This is the top 
of the stack trace in setTimestamp(int, Timestamp, Calendar):

at 
org.postgresql.jdbc2.AbstractJdbc2Statement.setTimestamp(AbstractJdbc2Statement.java:3049)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.setTimestamp(AbstractJdbc2Statement.java:1334)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1649)
at 
org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3Statement.java:1438)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1700)
at 
com.webobjects.jdbcadaptor.JDBCColumn.takeInputValue(JDBCColumn.java:569)
at 
com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindingsAndExecute(JDBCChannel.java:260)
at 
com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:337)
at 
com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:296)
at 
com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:220)
at 
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897)
at 
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234)
at 
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
at 
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
at 
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)

setObject() is called, and then eventually setTimestamp(int, Timestamp) then 
setTimestamp(int, Timestamp, null).  So I was wrong to implicate EOF even 
peripherally: looks like it's entirely the JDBC driver.


-- 
Paul.

http://logicsquad.net/


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: datepicker on AMD problem

2010-12-05 Thread Theodore Petrosky
This ADP is inline, however, i get the same result from a component action.

Ted


--- On Sun, 12/5/10, Simon  wrote:

From: Simon 
Subject: Re: datepicker on AMD problem
To: "Theodore Petrosky" 
Cc: webobjects-dev@lists.apple.com
Date: Sunday, December 5, 2010, 12:33 PM

are you rendering the content inline ? we use ADP in AMD's quite a bit and not 
seen this issue, but we render content from a component action. i'm wondering 
if rendering inline is somehow causing it to get confused about the location of 
the text field.

i'll also double check with our UI chap at work tomorrow because we've got 
various patches (read: hacks) associated with AMD and ADP.

simon

On 5 December 2010 17:05, Theodore Petrosky  wrote:

I have a little problem with a datepicker on an AMD. Here is an example app.



http://173.54.121.129/cgi-bin/WebObjects/DatePicker





this is simulating if I had a table of data that extends past the bottom of the 
display so i have to scroll down to click the link that brings in the AMD.



Is there something more I am supposed to be doing to make the DatePicker attach 
to the AMD and not the page that is bringing in the AMD?



Am I not supposed to use a ADP on an AMD?



Ted







 ___

Do not post admin requests to the list. They will be ignored.

Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)

Help/Unsubscribe/Update your Subscription:

http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk



This email sent to si...@potwells.co.uk







 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[ANN] Safari Extension 0.95

2010-12-05 Thread ISHIMOTO Ken
Hi @,

A new version of WebObject Safari Extension is available.

Download : http://www.webobjects.me/safari/woExtension/index.html

What's new?

* Blog is now on one extern Page. 

* Golipse download and explanation is now on one extern Page.

* Safari Extension explanation is new

* Add GoDeploy Icon. Go to an extern Page for Deploy Scripts. (under 
Construction)


Thank you


K's ROOM  (ISHIMOTO Ken)

[E-Mail]  
[iChat:]   
[HP]  http://www.ksroom.com/
_
This e-mail has not been scanned for viruses because it was written on an Mac,
and there are NO Viruses on an Apple Computer.
For further information visit http://www.apple.com



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: datepicker on AMD problem

2010-12-05 Thread Simon
are you rendering the content inline ? we use ADP in AMD's quite a bit and
not seen this issue, but we render content from a component action. i'm
wondering if rendering inline is somehow causing it to get confused about
the location of the text field.

i'll also double check with our UI chap at work tomorrow because we've got
various patches (read: hacks) associated with AMD and ADP.

simon

On 5 December 2010 17:05, Theodore Petrosky  wrote:

> I have a little problem with a datepicker on an AMD. Here is an example
> app.
>
> http://173.54.121.129/cgi-bin/WebObjects/DatePicker
>
>
> this is simulating if I had a table of data that extends past the bottom of
> the display so i have to scroll down to click the link that brings in the
> AMD.
>
> Is there something more I am supposed to be doing to make the DatePicker
> attach to the AMD and not the page that is bringing in the AMD?
>
> Am I not supposed to use a ADP on an AMD?
>
> Ted
>
>
>
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
>
> http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk
>
> This email sent to si...@potwells.co.uk
>
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

datepicker on AMD problem

2010-12-05 Thread Theodore Petrosky
I have a little problem with a datepicker on an AMD. Here is an example app.

http://173.54.121.129/cgi-bin/WebObjects/DatePicker


this is simulating if I had a table of data that extends past the bottom of the 
display so i have to scroll down to click the link that brings in the AMD.

Is there something more I am supposed to be doing to make the DatePicker attach 
to the AMD and not the page that is bringing in the AMD?

Am I not supposed to use a ADP on an AMD?

Ted


  
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Timestamps and PostgreSQL

2010-12-05 Thread Paul Hoadley
I just couldn't let this go.  Anyone not using PostgreSQL can tune out.

On 04/12/2010, at 9:47 AM, Paul Hoadley wrote:

>>> Displaying those times _without_ a formatter in the app shows the first 
>>> timestamp as '2010-12-03 04:51:55 Etc/GMT' which is exactly as expected, 
>>> but the second (that was entered from the console behind the app's back) as 
>>> '2010-12-02 18:21:55 Etc/GMT'.
>>> 
>>> Is it obvious to any other PostgreSQL users what is going on?  It looks 
>>> like the database server's machine-local timezone is being used to adjust 
>>> the timestamp somewhere between WebObjects and the database.
>> 
>> I agree.
> 
> After some furious Googling, it turns out that the JDBC driver is affected by 
> the 'user.timezone' system property.  Launching the app with 
> '-Duser.timezone=GMT' on my laptop (which otherwise gets set to 
> 'Australia/Adelaide') results in the behaviour I was expecting.  I assume 
> this was the missing link in the "UTC from top to bottom" chain, as I can see 
> from the logs that both app servers were picking up their respective local 
> values for this property.  Just to be clear, this doesn't actually matter too 
> much if the app is just running indefinitely on the same server: the 
> timestamps seem to be adjusted on the way in and back out of the database, so 
> that everything Just Works from within the app.  It was only when I dumped 
> and restored the database somewhere else that it became a problem.

The JDBC driver is, indeed, adjusting the timestamp, and apparently this is a 
feature.  EOF calls PreparedStatement.setTimestamp(int, Timestamp) (implemented 
in AbstractJdbc2Statement), which in turn calls 
PreparedStatement.setTimestamp(int, Timestamp, Calendar) with a null Calendar.  
To format the timestamp, TimestampUtils.toString(Calendar, Timestamp) is 
called, again with a null Calendar.  The null Calendar is replaced by a new 
GregorianCalendar(), which is used to format the string sent to the database.  
All of this is fine, _except_ that the GregorianCalendar's timezone turns out 
to be the machine-local timezone, despite calling 
TimeZone.setDefault(TimeZone.getTimeZone("GMT")) in the application's 
constructor.  (It's not obvious to me why this would be the case—does 
TimeZone.setDefault() not apply JVM-wide?)  In any case, setting the 
user.timezone system property (to UTC) _is_ sufficient to cause that 
GregorianCalendar to be constructed with its timezone set to UTC, and then the 
JDBC driver doesn't perform any adjustments to timestamps on the way in or out.

The PostgreSQL JDBC driver's behaviour strikes me as somewhat 
counter-intuitive, to say the least.  I'm pretty sure it nails the issue of 
keeping timestamps in UTC with Postgres, though.


-- 
Paul.

http://logicsquad.net/


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com