Amit Kelkar ([EMAIL PROTECTED]) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
Concurrent JDBC connections to result in wrong data

Long Description
We are designing a major enterprise resource management system for a client and are 
using java (servlets/JSP) with tomcat container for frontend, postgres 7.1 for the 
backend.

One one of the pages, which displays a client's invoices we have experienced what we 
believe may be a concurrency in postgres. 

If two users (we have not tried more) use different clients and click on the 
getInvoices button at the same time, the data becomes mixed. 
I.e.
If i say pick client 'smith trucks' and my collegue picks a client 'post modern', i 
get some of 'post modern' invoices (data) and he get some (if not a large portion) of 
'smith trucks' data. 

As you can imagine, this is an extremely serious issue. 

We were using postgres 6.5, but switched to 7.12 using JDBC driver jdbc7.0-1.2.jar. 
We were using connection pooling - poolman, but have taken this out now. So we are 
going directly to the db through the driver with class.foName etc. 
We are also now conecting as seperate uses (e.g. i connect as user 'amit', my collegue 
connects as user 'postgres'). 
We have also taken out any session objects, just incase this could be the problem.


None of this has worked at all. Postgres (or the driver) seems to be mixing up the 
data it returns and returns no erros. 

This is an urgent issue and we need to resolve. Any help would be appreciated. We have 
supplied some sample code, but all the code is too long to supply. 

Amit Kelkar
[EMAIL PROTECTED]
Post Modern
Sydney, Australia


Sample Code

   try{

invoiceQuery = "select clientinvoice.invoiceid,orderdate,clientid, eventstatusid, 
empid, contactid, noofguest,costtotal,tax, clientref from clientinvoice where 
clientinvoice.clientid =" +clienid + "and islast='true'  order by orderdate limit 15"

                Class.forName("org.postgresql.Driver");
Connection con = DriverManager.getConnection("jdbc:postgresql:trufdev", user , pass);
                Statement stClientInvoice= con.createStatement();
                clientInvoices = stClientInvoice.executeQuery(invoiceQuery);

        }
        catch(Exception ex){System.err.println("clientShow at connect" + 
ex.getMessage());}


if (clientInvoices != null) {
                try{
                        while ( clientInvoices.next() ) {

                                clientInvoiceBean invoiceBean = new 
clientInvoiceBean();
                                gblInvoiceBean = invoiceBean;


                                invoiceid = clientInvoices.getInt("invoiceid");
                                noOfGuest = clientInvoices.getInt("noofguest");
                                clientRef = clientInvoices.getString("clientref");
                                orderDate = clientInvoices.getString("orderDate");


// etc. etc. --> goes onto set values in a java bean and then display on jsp. 


No file was uploaded with this report


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to