Обсуждение: Strange loss of data during INSERT
Hi everybody,
i’m having a very strange Problem:
My JEE Application initially persists Users at startup.
The problem is that the passwords are not stored,
while other data with the same datatype on this table are stored correctly!?!
If I turn log_statement to ‘all’ in config I can see the INSERT statement including the correct password(!!!) in log file,
but if I take a look with pgAdmin all password fields are empty…
When I try to execute the insert statement in pgAdmin it works fine.
By the way: If I switch the DB to OracleXE, it works fine
(But actually I don’t want to user Oracle… )
Thanks for any ideas
Sebastian Altmann
________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Tel.: +49/(911) - 99594-0
Fax: +49/(911) - 99594-129
mailto:Sebastian.Altmann@isogmbh.de
http://www.isogmbh.de
Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Harald Goeb
Sitz: Nürnberg
Hi everybody,
i’m having a very strange Problem:
My JEE Application initially persists Users at startup.
The problem is that the passwords are not stored,
while other data with the same datatype on this table are stored correctly!?!
If I turn log_statement to ‘all’ in config I can see the INSERT statement including the correct password(!!!) in log file,
but if I take a look with pgAdmin all password fields are empty…
When I try to execute the insert statement in pgAdmin it works fine.
By the way: If I switch the DB to OracleXE, it works fine
(But actually I don’t want to user Oracle… )
Thanks for any ideas
Sebastian Altmann
________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Tel.: +49/(911) - 99594-0
mailto:Sebastian.Altmann@isogmbh.de
Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Harald Goeb
Sitz: Nürnberg
--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw
Thanks for your answer.
I’m not sure if the Password is NULL or a empty string,
I will check this in the evening, I have no access no…
If I run the INSERT statement from pgAdmin it works fine!
Here is the statement from the log file (with original personal data, after this are just my dummy entries for development):
BEGIN
insert into player (birthdate, eMail, firstname, lastname, password, username, id) values ($1, $2, $3, $4, $5, $6, $7)
Parameter: $1 = '3885-08-14 00:00:00', $2 = 'alt@isogmbh.de', $3 = 'Sebastian', $4 = 'Altmann', $5 = 'alt.iso', $6 = 'alt', $7 = '54'
COMMIT
Sebastian Altmann
________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Tel.: +49/(911) - 99594-0
Fax: +49/(911) - 99594-129
mailto:Sebastian.Altmann@isogmbh.de
http://www.isogmbh.de
Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Harald Goeb
Sitz: Nürnberg
Von: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] Im Auftrag von Willy-Bas Loos
Gesendet: Donnerstag, 24. März 2011 12:16
An: Altmann, Sebastian
Cc: pgsql-general@postgresql.org
Betreff: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT
Are you sure the password is NULL? Some fields are not shown in pgAdmin if they are too long, but that seems improbable to me for passwords.
pgAdmin also has an option "Show NULL values as <NULL>" (in file|options|query).
If you take the SQL from the log, can you reproduce this in postgres?
If so, please email the code (i hope it's work with personal data scrambled ?).
cheers,
WBL
On Thu, Mar 24, 2011 at 12:01 PM, Altmann, Sebastian <Sebastian.Altmann@isogmbh.de> wrote:
Hi everybody,
i’m having a very strange Problem:
My JEE Application initially persists Users at startup.
The problem is that the passwords are not stored,
while other data with the same datatype on this table are stored correctly!?!
If I turn log_statement to ‘all’ in config I can see the INSERT statement including the correct password(!!!) in log file,
but if I take a look with pgAdmin all password fields are empty…
When I try to execute the insert statement in pgAdmin it works fine.
By the way: If I switch the DB to OracleXE, it works fine
(But actually I don’t want to user Oracle… )
Thanks for any ideas
Sebastian Altmann
________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Tel.: +49/(911) - 99594-0
mailto:Sebastian.Altmann@isogmbh.de
Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Harald Goeb
Sitz: Nürnberg
--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw
On Thursday, March 24, 2011 4:26:30 am Altmann, Sebastian wrote: > Thanks for your answer. > > > > I'm not sure if the Password is NULL or a empty string, > > I will check this in the evening, I have no access no... I thought you saw the passwords in the log file which would seem to indicate NOT NULL or not empty string. > > > > > > If I run the INSERT statement from pgAdmin it works fine! Are you sure your JEE app and pgAdmin are both pointing at the same database? > > > > Here is the statement from the log file (with original personal data, > after this are just my dummy entries for development): > > > > BEGIN > > insert into player (birthdate, eMail, firstname, lastname, password, > username, id) values ($1, $2, $3, $4, $5, $6, $7) > > > Parameter: $1 = '3885-08-14 00:00:00', $2 = 'alt@isogmbh.de', $3 = > 'Sebastian', $4 = 'Altmann', $5 = 'alt.iso', $6 = 'alt', $7 = '54' > > > COMMIT > > > > > > > > > > Sebastian Altmann > > ________________________________ > > > > ISO Software Systeme GmbH > > Eichendorffstrasse 29 > > 90491 Nürnberg > > > > Tel.: +49/(911) - 99594-0 > > Fax: +49/(911) - 99594-129 > > > > mailto:Sebastian.Altmann@isogmbh.de > > http://www.isogmbh.de > > > > Amtsgericht Nürnberg HRB 18299 > > Geschäftsführer: Harald Goeb > > Sitz: Nürnberg > > > > Von: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] Im Auftrag von Willy-Bas > Loos > Gesendet: Donnerstag, 24. März 2011 12:16 > An: Altmann, Sebastian > Cc: pgsql-general@postgresql.org > Betreff: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT > > > > Are you sure the password is NULL? Some fields are not shown in pgAdmin > if they are too long, but that seems improbable to me for passwords. > > pgAdmin also has an option "Show NULL values as <NULL>" (in > file|options|query). > > > > If you take the SQL from the log, can you reproduce this in postgres? > > If so, please email the code (i hope it's work with personal data > scrambled ?). > > > > cheers, > > > > WBL > > On Thu, Mar 24, 2011 at 12:01 PM, Altmann, Sebastian > <Sebastian.Altmann@isogmbh.de> wrote: > > Hi everybody, > > > > i'm having a very strange Problem: > > > > My JEE Application initially persists Users at startup. > > > > The problem is that the passwords are not stored, > > while other data with the same datatype on this table are stored > correctly!?! > > > > If I turn log_statement to 'all' in config I can see the INSERT > statement including the correct password(!!!) in log file, > > but if I take a look with pgAdmin all password fields are empty... > > > > When I try to execute the insert statement in pgAdmin it works fine. > > > > By the way: If I switch the DB to OracleXE, it works fine > > (But actually I don't want to user Oracle... ) > > > > > > Thanks for any ideas > > > > > > Sebastian Altmann > > ________________________________ > > > > ISO Software Systeme GmbH > > Eichendorffstrasse 29 > > 90491 Nürnberg > > > > Tel.: +49/(911) - 99594-0 <tel:%2B49%2F%28911%29%20-%2099594-0> > > Fax: +49/(911) - 99594-129 <tel:%2B49%2F%28911%29%20-%2099594-129> > > > > mailto:Sebastian.Altmann@isogmbh.de > > http://www.isogmbh.de > > > > Amtsgericht Nürnberg HRB 18299 > > Geschäftsführer: Harald Goeb > > Sitz: Nürnberg -- Adrian Klaver adrian.klaver@gmail.com
WHAT THE HELL!?!
Just came home from work
and did another testing:
I access my JEE App via EJBs and this is what i'm doing to create my users at startup: i call the LOCAL BeanInterface
and the result is that my passwords get lost.
By the way this is the same behavior when i rename password to city and put it e.g. from column 5 to 3 -> city is not stored.
But now the hammer:
I can also call the REMOTE Interface of my bean from another program when my server has started,
and BAM! password, city or whatever is stored properly!
For the ones who do not now EJB: the Implementation is exactly the same for my remote and local interface,
i debuged and saw that the passwords are there, i looked into the postgre logfile and saw the insert statement with pw value is ok, ...
This is really ill sh... but i can live with that, as far as i know and it works when i call the createPlayer() method properly from remote interface when server has started.
Next thing i will try is to use EJB remote interface internally which also works, but is slower
Thanks for everybodies help
Sebastian Altmann
________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Tel.: +49/(911) - 99594-0
Fax: +49/(911) - 99594-129
mailto:Sebastian.Altmann@isogmbh.de
http://www.isogmbh.de
Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Harald Goeb
Sitz: Nürnberg
-----Ursprüngliche Nachricht-----
Von: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Gesendet: Do 24.03.2011 15:01
An: pgsql-general@postgresql.org
Cc: Altmann, Sebastian; Willy-Bas Loos
Betreff: Re: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT
On Thursday, March 24, 2011 4:26:30 am Altmann, Sebastian wrote:
> Thanks for your answer.
>
>
>
> I'm not sure if the Password is NULL or a empty string,
>
> I will check this in the evening, I have no access no...
I thought you saw the passwords in the log file which would seem to indicate NOT
NULL or not empty string.
>
>
>
>
>
> If I run the INSERT statement from pgAdmin it works fine!
Are you sure your JEE app and pgAdmin are both pointing at the same database?
>
>
>
> Here is the statement from the log file (with original personal data,
> after this are just my dummy entries for development):
>
>
>
> BEGIN
>
> insert into player (birthdate, eMail, firstname, lastname, password,
> username, id) values ($1, $2, $3, $4, $5, $6, $7)
>
>
> Parameter: $1 = '3885-08-14 00:00:00', $2 = 'alt@isogmbh.de', $3 =
> 'Sebastian', $4 = 'Altmann', $5 = 'alt.iso', $6 = 'alt', $7 = '54'
>
>
> COMMIT
>
>
>
>
>
>
>
>
>
> Sebastian Altmann
>
> ________________________________
>
>
>
> ISO Software Systeme GmbH
>
> Eichendorffstrasse 29
>
> 90491 Nürnberg
>
>
>
> Tel.: +49/(911) - 99594-0
>
> Fax: +49/(911) - 99594-129
>
>
>
> mailto:Sebastian.Altmann@isogmbh.de
>
> http://www.isogmbh.de
>
>
>
> Amtsgericht Nürnberg HRB 18299
>
> Geschäftsführer: Harald Goeb
>
> Sitz: Nürnberg
>
>
>
> Von: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] Im Auftrag von Willy-Bas
> Loos
> Gesendet: Donnerstag, 24. März 2011 12:16
> An: Altmann, Sebastian
> Cc: pgsql-general@postgresql.org
> Betreff: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT
>
>
>
> Are you sure the password is NULL? Some fields are not shown in pgAdmin
> if they are too long, but that seems improbable to me for passwords.
>
> pgAdmin also has an option "Show NULL values as <NULL>" (in
> file|options|query).
>
>
>
> If you take the SQL from the log, can you reproduce this in postgres?
>
> If so, please email the code (i hope it's work with personal data
> scrambled ?).
>
>
>
> cheers,
>
>
>
> WBL
>
> On Thu, Mar 24, 2011 at 12:01 PM, Altmann, Sebastian
> <Sebastian.Altmann@isogmbh.de> wrote:
>
> Hi everybody,
>
>
>
> i'm having a very strange Problem:
>
>
>
> My JEE Application initially persists Users at startup.
>
>
>
> The problem is that the passwords are not stored,
>
> while other data with the same datatype on this table are stored
> correctly!?!
>
>
>
> If I turn log_statement to 'all' in config I can see the INSERT
> statement including the correct password(!!!) in log file,
>
> but if I take a look with pgAdmin all password fields are empty...
>
>
>
> When I try to execute the insert statement in pgAdmin it works fine.
>
>
>
> By the way: If I switch the DB to OracleXE, it works fine
>
> (But actually I don't want to user Oracle... )
>
>
>
>
>
> Thanks for any ideas
>
>
>
>
>
> Sebastian Altmann
>
> ________________________________
>
>
>
> ISO Software Systeme GmbH
>
> Eichendorffstrasse 29
>
> 90491 Nürnberg
>
>
>
> Tel.: +49/(911) - 99594-0 <tel:%2B49%2F%28911%29%20-%2099594-0>
>
> Fax: +49/(911) - 99594-129 <tel:%2B49%2F%28911%29%20-%2099594-129>
>
>
>
> mailto:Sebastian.Altmann@isogmbh.de
>
> http://www.isogmbh.de
>
>
>
> Amtsgericht Nürnberg HRB 18299
>
> Geschäftsführer: Harald Goeb
>
> Sitz: Nürnberg
--
Adrian Klaver
adrian.klaver@gmail.com
Hmm... Please attach your log with parameters passed to server, you said only about statement not about passwords. As well You provieded small number of information about your EE app (but it's starnge it works on Oracle). Is it EJB 3 or 2 app, and do you use EJB Entities or JPA ones? My suggestion is you should look carefully at logs, and statuses of transactions, check if password is passed, look for any error about one statements, check if in some way the passwords aren't updated once again. Do you see COMMIT/ROLLBACK in log? Regards, Radek. "Altmann, Sebastian" <Sebastian.Altmann@isogmbh.de> Thursday 24 March 2011 18:20:38 > WHAT THE HELL!?! > > Just came home from work > and did another testing: > > I access my JEE App via EJBs and this is what i'm doing to create my > users at startup: i call the LOCAL BeanInterface > and the result is that my passwords get lost. > By the way this is the same behavior when i rename password to city and > put it e.g. from column 5 to 3 -> city is not stored. > > > But now the hammer: > I can also call the REMOTE Interface of my bean from another program > when my server has started, > and BAM! password, city or whatever is stored properly! > > For the ones who do not now EJB: the Implementation is exactly the same > for my remote and local interface, > i debuged and saw that the passwords are there, i looked into the > postgre logfile and saw the insert statement with pw value is ok, ... > > > This is really ill sh... but i can live with that, as far as i know and > it works when i call the createPlayer() method properly from remote > interface when server has started. > > > Next thing i will try is to use EJB remote interface internally which > also works, but is slower > > > Thanks for everybodies help > > > > > Sebastian Altmann > ________________________________ > > ISO Software Systeme GmbH > Eichendorffstrasse 29 > 90491 Nürnberg > > Tel.: +49/(911) - 99594-0 > Fax: +49/(911) - 99594-129 > > mailto:Sebastian.Altmann@isogmbh.de > http://www.isogmbh.de > > Amtsgericht Nürnberg HRB 18299 > Geschäftsführer: Harald Goeb > Sitz: Nürnberg > > > > -----Ursprüngliche Nachricht----- > Von: Adrian Klaver [mailto:adrian.klaver@gmail.com] > Gesendet: Do 24.03.2011 15:01 > An: pgsql-general@postgresql.org > Cc: Altmann, Sebastian; Willy-Bas Loos > Betreff: Re: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT > > On Thursday, March 24, 2011 4:26:30 am Altmann, Sebastian wrote: > > Thanks for your answer. > > > > > > > > I'm not sure if the Password is NULL or a empty string, > > > > I will check this in the evening, I have no access no... > > I thought you saw the passwords in the log file which would seem to > indicate NOT > NULL or not empty string. > > > If I run the INSERT statement from pgAdmin it works fine! > > Are you sure your JEE app and pgAdmin are both pointing at the same > database? > > > Here is the statement from the log file (with original personal data, > > after this are just my dummy entries for development): > > > > > > > > BEGIN > > > > insert into player (birthdate, eMail, firstname, lastname, password, > > username, id) values ($1, $2, $3, $4, $5, $6, $7) > > > > > > Parameter: $1 = '3885-08-14 00:00:00', $2 = 'alt@isogmbh.de', $3 = > > 'Sebastian', $4 = 'Altmann', $5 = 'alt.iso', $6 = 'alt', $7 = '54' > > > > > > COMMIT > > > > > > > > > > > > > > > > > > > > Sebastian Altmann > > > > ________________________________ > > > > > > > > ISO Software Systeme GmbH > > > > Eichendorffstrasse 29 > > > > 90491 Nürnberg > > > > > > > > Tel.: +49/(911) - 99594-0 > > > > Fax: +49/(911) - 99594-129 > > > > > > > > mailto:Sebastian.Altmann@isogmbh.de > > > > http://www.isogmbh.de > > > > > > > > Amtsgericht Nürnberg HRB 18299 > > > > Geschäftsführer: Harald Goeb > > > > Sitz: Nürnberg > > > > > > > > Von: pgsql-general-owner@postgresql.org > > [mailto:pgsql-general-owner@postgresql.org] Im Auftrag von Willy-Bas > > Loos > > Gesendet: Donnerstag, 24. März 2011 12:16 > > An: Altmann, Sebastian > > Cc: pgsql-general@postgresql.org > > Betreff: [RMX:#] Re: [GENERAL] Strange loss of data during INSERT > > > > > > > > Are you sure the password is NULL? Some fields are not shown in > > pgAdmin > > > if they are too long, but that seems improbable to me for passwords. > > > > pgAdmin also has an option "Show NULL values as <NULL>" (in > > file|options|query). > > > > > > > > If you take the SQL from the log, can you reproduce this in postgres? > > > > If so, please email the code (i hope it's work with personal data > > scrambled ?). > > > > > > > > cheers, > > > > > > > > WBL > > > > On Thu, Mar 24, 2011 at 12:01 PM, Altmann, Sebastian > > <Sebastian.Altmann@isogmbh.de> wrote: > > > > Hi everybody, > > > > > > > > i'm having a very strange Problem: > > > > > > > > My JEE Application initially persists Users at startup. > > > > > > > > The problem is that the passwords are not stored, > > > > while other data with the same datatype on this table are stored > > correctly!?! > > > > > > > > If I turn log_statement to 'all' in config I can see the INSERT > > statement including the correct password(!!!) in log file, > > > > but if I take a look with pgAdmin all password fields are empty... > > > > > > > > When I try to execute the insert statement in pgAdmin it works fine. > > > > > > > > By the way: If I switch the DB to OracleXE, it works fine > > > > (But actually I don't want to user Oracle... ) > > > > > > > > > > > > Thanks for any ideas > > > > > > > > > > > > Sebastian Altmann > > > > ________________________________ > > > > > > > > ISO Software Systeme GmbH > > > > Eichendorffstrasse 29 > > > > 90491 Nürnberg > > > > > > > > Tel.: +49/(911) - 99594-0 <tel:%2B49%2F%28911%29%20-%2099594-0> > > > > Fax: +49/(911) - 99594-129 <tel:%2B49%2F%28911%29%20-%2099594-129> > > > > > > > > mailto:Sebastian.Altmann@isogmbh.de > > > > http://www.isogmbh.de > > > > > > > > Amtsgericht Nürnberg HRB 18299 > > > > Geschäftsführer: Harald Goeb > > > > Sitz: Nürnberg