[Pljava-dev] ResultSet from trigger screwy with timestamp type

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] ResultSet from trigger screwy with timestamp type
Date: 2005-09-01 05:59:31
Message-ID: thhal-0RzHyA52I8LQUSDjgqYik1YUhlY+qD9@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Hi John,
There has been some problems with timestamps before that where related
to how PostgreSQL was compiled (using integer datetimes or not) but that
was fixed some time ago to allow PL/Java dynamically adapt at runtime.

I'm a bit uncertain of what versions you are using. There's no binary
distribution of PL/Java for gcj. Perhaps you consider gcj "binary java"?
If so, what version of gcj do you have when you compile and what version
of the PL/Java source are you using?

Regards,
Thomas Hallgren

Burtenshaw, John J. wrote:

>
> Greetings. I am using PLJava to fire a trigger on a table as such:
>
> CREATE FUNCTION statsupdate( )
> RETURNS "trigger"
> LANGUAGE 'java'
> AS
> 'com.cooperstandard.statsanalysis.RheologicTrigger.tfunction';
>
> CREATE TRIGGER mv_trigger AFTER INSERT ON mv_results FOR EACH ROW
> EXECUTE PROCEDURE statsupdate();
>
> The 'mv_table' that the trigger is made on appears below:
>
> Column Type
> batch_number integer
> date timestamp
> part_number text
> compound text
> batch_status character(1)
> ml_torq double precision
> mlplus2_torq double precision
> mlplus4_torq double precision
> ts5_time double precision
> ts10_time double precision
> ts35_time double precision
> internal_status character(1)
> instrument integer
>
>
> Everything is fine till the ResultSet from the trigger is examined
> which shows something other than the correct
> value for the 'date' column which is a timestamp type.
> For example the statement "insert into mv_results values( 1011784,
> 'now', '63484', '9620-60', 'a', 50.4, 51.3, 0, 0, 0, 0, 'a', 6);'
>
> Puts a timestamp of '2005-08-31 10:01:21.731671-04' into the database,
> but the java code:
>
> public static void tfunction( TriggerData td ) throws SQLException,
> Exception
> {
> ResultSet insertedRow = td.getNew();
> Logger.getAnonymousLogger().info( "The date: " +
> insertedRow.getTimestamp("date"));
> ....
>
> gives:
> Aug 31 10:01:22 r3development postgres[2636]: [27-1] INFO: 31 Aug 05
> 09:01:22 com.cooperstandard.stats
> analysis.RheologicTrigger The date: 1975-09-22 02:47:56.000671
>
> All the other column give the correct value. Is there something I am
> missing? Your thoughts would be appreciated.
>
>
> Regards,
> John Burtenshaw
>
> PS
> I am using postgresql 8.0 on a linux (debian) platform and the binary
> version pljava (vs the gcj version).
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Pljava-dev mailing list
>Pljava-dev at gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>
>

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Burtenshaw, John J. 2005-09-02 13:40:43 [Pljava-dev] ResultSet from trigger screwy with timestamp type
Previous Message Burtenshaw, John J. 2005-08-31 15:19:15 [Pljava-dev] ResultSet from trigger screwy with timestamp type