Column names are hidden using informix database
Posted in 2013
A user reported that after inserting rows via Hibernate 3.0 (JSP app, Informix 11.70, UTF-8 locales, Marathi text), some column names and their data appeared to be "hidden" when querying the table, and the app showed older values. Marcus Haarmann asked about transactions/flushing, isolation and SQL logging, then after seeing screenshots concluded the data was actually stored correctly: dbaccess simply can't display columns properly when values contain line breaks. He suggested UNLOAD to a file to verify, which confirmed all data was present. The remaining issue of the application not showing newly inserted values was attributed to the app's handling/display of line breaks; no fix for that part is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Hello, I have one problem to retrieve data using informix database. If I insert data in informix database using hibernate(hql query) through application then columns are hidden. So I can not retrieve the latest inserted data for that column from the table. Please give me solution for that. Waiting for reply. Thanks Priyanka Mokhadkar
Hi, we have been using Hibernate+Informix for many years. We do not have this problem, but I am not sure what really is the problem ... So, what is your setup ? When do you try to read the data ? (When the transaction is finished or while the transaction is running), What type of isolation did you choose ? (how is your datasource set up, are you working with a transaction manager ?) When inserting data with Hibernate, the engine does not (depending on your primary key strategy) write any data to the database immediately. Also updates of data are not written to DB, but cached in the Hibernate Cache. Only when you flush the session or on finishing the transaction, you will get a write to database. That way, you might encounter the situation that doing multiple things in a transaction there will happen no changes in database. When you rollback now, the database does not do anything, only the Hibernate Cache is "forgotten". This prevents many db rollbacks. Marcus Haarmann ----- Ursprüngliche Mail ----- Von: "PRIYANKA MOKHADKAR" <priyanka@avantisoftware.in> An: ids@iiug.org Gesendet: Samstag, 20. April 2013 14:54:23 Betreff: Column names are hidden using informix database [30114] Hello, I have one problem to retrieve data using informix database. If I insert data in informix database using hibernate(hql query) through application then columns are hidden. So I can not retrieve the latest inserted data for that column from the table. Please give me solution for that. Waiting for reply. Thanks Priyanka Mokhadkar ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Yes, Rhonda Hackenburg Sent from my iPhone On Apr 21, 2013, at 12:58 PM, "Marcus Haarmann" <marcus.haarmann@midoco.de> wrote: > Hi, > > we have been using Hibernate+Informix for many years. We do not have this > problem, but I am not sure what really is the problem ... > > So, what is your setup ? When do you try to read the data ? (When the > transaction is finished or while the transaction is running), > What type of isolation did you choose ? (how is your datasource set up, are > you working with a transaction manager ?) > When inserting data with Hibernate, the engine does not (depending on your > primary key strategy) write > any data to the database immediately. Also updates of data are not written to > DB, but cached in the Hibernate Cache. > Only when you flush the session or on finishing the transaction, you will get > a write to database. > That way, you might encounter the situation that doing multiple things in a > transaction there will happen > no changes in database. When you rollback now, the database does not do > anything, only the Hibernate Cache > is "forgotten". This prevents many db rollbacks. > > Marcus Haarmann > > ----- Ursprüngliche Mail ----- > > Von: "PRIYANKA MOKHADKAR" <priyanka@avantisoftware.in> > An: ids@iiug.org > Gesendet: Samstag, 20. April 2013 14:54:23 > Betreff: Column names are hidden using informix database [30114] > > Hello, > I have one problem to retrieve data using informix database. > If I insert data in informix database using hibernate(hql query) through > application then columns are hidden. So I can not retrieve the latest inserted > data for that column from the table. > > Please give me solution for that. > Waiting for reply. > Thanks > Priyanka Mokhadkar > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >
Hello Marcus Haarmann Thanks for replying. We are using eclipse Ganymede with hibernate 3.0, informix 11.70 database, isolation level committed read. Informix JAR files have been used for connection. From the eclipse editor in jsp page using combo box we retrieve data to insert. After that on save button click we are calling java function in which we used instance of POJO(Plain Old Java Object) class where we mapped all the database fields. note that to insert data we used session.save(instance of POJO class) Using all these things we are trying to insert data, and now here we are loosing column name. We lost the column name in Database but the old data is being displayed in application. I don't know what happened. Please give me solution. Thanks Priyanka Mokhadkar
Hmm,
I still cannot understand what your real problem is.
According to your description, you insert data using session.save (),
which should result in an insert operation on db side.
This does succeed without error ? Have you tried to set logging for Hibernate
so it will print you the resulting SQL which is executed in a log file ?
Check with dbaccess and a select statement if your data is really in the DB
table.
If a column is empty, your mapping might be incorrect (but this should normally
result in an error while saving the data).
Then you retrieve the data from your JSP page again, but a certain column
contains old data ? For an insert operation, there is no "old" data.
Please describe your problem better,
Btw, this does not look like an Informix problem but a Hibernate problem.
Also, Hibernate 3.0 is very outdated, but should work for your needs.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "PRIYANKA MOKHADKAR" <priyanka@avantisoftware.in>
An: ids@iiug.org
Gesendet: Montag, 22. April 2013 11:06:05
Betreff: Re: Column names are hidden using informix dat.... [30117]
Hello Marcus Haarmann
Thanks for replying.
We are using eclipse Ganymede with hibernate 3.0, informix 11.70 database,
isolation level committed read. Informix JAR files have been used for
connection.
>From the eclipse editor in jsp page using combo box we retrieve data to
insert. After that on save button click we are calling java function in which
we used instance of POJO(Plain Old Java Object) class where we mapped all the
database fields. note that to insert data we used session.save(instance of
POJO class) Using all these things we are trying to insert data, and now here
we are loosing column name.
We lost the column name in Database but the old data is being displayed in
application. I don't know what happened.
Please give me solution.
Thanks
Priyanka Mokhadkar
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Hi Priyanka,
from what I have seen from the screenshots you sent me, the data is hidden in
the output of dbaccess
but probably is correctly stored in the database. This might be because
dbaccess has a limited width of screen
and a line break in the data might hide the next output. There is no way to
make this output in dbaccess
look better.
Try to make an unload to "/tmp/xxx" select .... and take a look in the
resulting file.
You will see all the data is there.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "Priyanka" <priyanka@avantisoftware.in>
An: "marcus haarmann" <marcus.haarmann@midoco.de>
CC: "Sandip shinde" <sandip.shinde@avantisoftware.in>
Gesendet: Dienstag, 23. April 2013 07:53:25
Betreff: Re: Column names are hidden using informix dat.... [30118]
Hello Sir,
Thanks for reply.
On informix 11.70 database side we are using:
Isolation Level : Committed Read
CLIENT_LOCALE=EN_US.UTF8
DB_LOCALE=EN_US.UTF8
I am sending screen shots of the application & data retrieve from informix.
Please find attachments.
1. First time insert data using application for that attached file
first_insert_data_using_application.jpg , in that form when click on check box
& click on button then those values are inserted in to table for that used
hibernate 3.0 manager class, in that create session factory object after that
begin transaction, save session & commit transaction.
2. Attached file first_record_in_database.jpg : Using dbaccess on database
side retrieve inserted data from table(All columns).
3. Second time insert data using application we get all data from database for
that attached file name is: second_time_insert_using_application.jpg & Using
dbaccess file is secondrecord_in_database.jpg
4. Third time insert data using application we not get all data from database
for that attached file name is: third_time_insert_using_application.jpg &
Using dbaccess file is thirdrecord_in_database.jpg. In this not retrieve all
data from table, two column names are hidden & respective data also hidden.
5. This hidden of column names does not occur in same way as described, the
sequence may or may not be changed.
6. We used to insert data in Marathi Language format
So please give me solution for that.
Waiting for your reply.
---
Thanks & Regards
Priyanka Mokhadkar
Avanti Software Solutions Pvt. Ltd.
Navi Peth, Pune.
On 22-04-2013, Marcus Haarmann wrote:
Hmm,
I still cannot understand what your real problem is.
According to your description, you insert data using session.save (),
which should result in an insert operation on db side.
This does succeed without error ? Have you tried to set logging for Hibernate
so it will print you the resulting SQL which is executed in a log file ?
Check with dbaccess and a select statement if your data is really in the DB
table.
If a column is empty, your mapping might be incorrect (but this should
normally
result in an error while saving the data).
Then you retrieve the data from your JSP page again, but a certain column
contains old data ? For an insert operation, there is no "old" data.
Please describe your problem better,
Btw, this does not look like an Informix problem but a Hibernate problem.
Also, Hibernate 3.0 is very outdated, but should work for your needs.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "PRIYANKA MOKHADKAR" < priyanka@avantisoftware.in >
An: ids@iiug.org Gesendet: Montag, 22. April 2013 11:06:05
Betreff: Re: Column names are hidden using informix dat.... [30117]
Hello Marcus Haarmann
Thanks for replying.
We are using eclipse Ganymede with hibernate 3.0, informix 11.70 database,
isolation level committed read. Informix JAR files have been used for
connection.
<blockquote>
From the eclipse editor in jsp page using combo box we retrieve data to
insert. After that on save button click we are calling java function in which
we used instance of POJO(Plain Old Java Object) class where we mapped all the
database fields. note that to insert data we used session.save(instance of
POJO class) Using all these things we are trying to insert data, and now here
we are loosing column name.
We lost the column name in Database but the old data is being displayed in
application. I don't know what happened.
Please give me solution.
Thanks
Priyanka Mokhadkar
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
</blockquote>
Hi,
as I stated, dbaccess will not display such columns with line breaks correctly.
There is no workaround.
In case the data is correctly in the unload file, it is just a problem of
visibility in dbaccess,
not of general database storage, as the data seems to be ok in the table.
You should check your program how it deals with data containing line breaks,
cause that might be the problem. I dont think we have an Informix problem here
nor a Hibernate problem, cause both should read the stored data.
Maybe it is your way to display the data in HTML form.
But I cannot help here.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "Priyanka" <priyanka@avantisoftware.in>
An: "Marcus Haarmann" <marcus.haarmann@midoco.de>
Gesendet: Dienstag, 23. April 2013 09:26:30
Betreff: Re: Fwd: Column names are hidden using informix dat.... [30118]
Hello Haarmann,
Thanks.
I Tried to make an unload to "/tmp/xxx" which is located at $INFORMIXDIR/tmp
path.
But I can not get proper data on dbaccess window.
Using output file I received all data but using application I can not retrieve
the inserted data for those hidden columns.
It shows the previous inserted data.
---
Thanks & Regards
Priyanka Mokhadkar
Avanti Software Solutions Pvt. Ltd.
Navi Peth, Pune.
On 23-04-2013, Marcus Haarmann wrote:
Hi Priyanka,
from what I have seen from the screenshots you sent me, the data is hidden in
the output of dbaccess
but probably is correctly stored in the database. This might be because
dbaccess has a limited width of screen
and a line break in the data might hide the next output. There is no way to
make this output in dbaccess
look better.
Try to make an unload to "/tmp/xxx" select .... and take a look in the
resulting file.
You will see all the data is there.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "Priyanka"
An: "marcus haarmann"
CC: "Sandip shinde"
Gesendet: Dienstag, 23. April 2013 07:53:25
Betreff: Re: Column names are hidden using informix dat.... [30118]
Hello Sir,
Thanks for reply.
On informix 11.70 database side we are using:
Isolation Level : Committed Read
CLIENT_LOCALE=EN_US.UTF8
DB_LOCALE=EN_US.UTF8
I am sending screen shots of the application & data retrieve from informix.
Please find attachments.
1. First time insert data using application for that attached file
first_insert_data_using_application.jpg , in that form when click on check box
& click on button then those values are inserted in to table for that used
hibernate 3.0 manager class, in that create session factory object after that
begin transaction, save session & commit transaction.
2. Attached file first_record_in_database.jpg : Using dbaccess on database
side retrieve inserted data from table(All columns).
3. Second time insert data using application we get all data from database for
that attached file name is: second_time_insert_using_application.jpg & Using
dbaccess file is secondrecord_in_database.jpg
4. Third time insert data using application we not get all data from database
for that attached file name is: third_time_insert_using_application.jpg &
Using dbaccess file is thirdrecord_in_database.jpg. In this not retrieve all
data from table, two column names are hidden & respective data also hidden.
5. This hidden of column names does not occur in same way as described, the
sequence may or may not be changed.
6. We used to insert data in Marathi Language format
So please give me solution for that.
Waiting for your reply.
---
Thanks & Regards
Priyanka Mokhadkar
Avanti Software Solutions Pvt. Ltd.
Navi Peth, Pune.
On 22-04-2013, Marcus Haarmann wrote:
<blockquote>
Hmm,
I still cannot understand what your real problem is.
According to your description, you insert data using session.save (),
which should result in an insert operation on db side.
This does succeed without error ? Have you tried to set logging for Hibernate
so it will print you the resulting SQL which is executed in a log file ?
Check with dbaccess and a select statement if your data is really in the DB
table.
If a column is empty, your mapping might be incorrect (but this should
normally
result in an error while saving the data).
Then you retrieve the data from your JSP page again, but a certain column
contains old data ? For an insert operation, there is no "old" data.
Please describe your problem better,
Btw, this does not look like an Informix problem but a Hibernate problem.
Also, Hibernate 3.0 is very outdated, but should work for your needs.
Marcus Haarmann
----- Ursprüngliche Mail -----
Von: "PRIYANKA MOKHADKAR" < priyanka@avantisoftware.in >
An: ids@iiug.org Gesendet: Montag, 22. April 2013 11:06:05
Betreff: Re: Column names are hidden using informix dat.... [30117]
Hello Marcus Haarmann
Thanks for replying.
We are using eclipse Ganymede with hibernate 3.0, informix 11.70 database,
isolation level committed read. Informix JAR files have been used for
connection.
<blockquote>
From the eclipse editor in jsp page using combo box we retrieve data to
insert. After that on save button click we are calling java function in which
we used instance of POJO(Plain Old Java Object) class where we mapped all the
database fields. note that to insert data we used session.save(instance of
POJO class) Using all these things we are trying to insert data, and now here
we are loosing column name.
We lost the column name in Database but the old data is being displayed in
application. I don't know what happened.
Please give me solution.
Thanks
Priyanka Mokhadkar
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
</blockquote>
</blockquote>