• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in using Database Connection for write/read  RSS feed

 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a simple application to write/read data to/from a database.

In my implementation I am using the same Connection in a program run to write as well as read data. I.e once the Connection is open, it is closed only when the program exits.

The problem I am facing is that if I write some data and try to read it in the same session (ie. program execution) I am unable to find the data I inserted recently.

The data is however visible in subsequent runs of the program.

I found from the java docs that Connections are by default auto commit. So I am expecting that search on data inserted in the same program run should return the data.

Any information on how to avoid this problem ?

Thanks,

Vinayak
 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore this topic... the problem was in the logic implementation ...

It is working fine now..

-Vinayak
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!