same problem with v044, on queries :
I used this code :
public synchronized  ResultSet queryDB(String q)
        {
                boolean al=true;
                if(!p.lock){
                        p.lock=true;
                        al=false;
                }
                ResultSet rs=null;
                try {Statement stmt = conn.createStatement();
                rs= stmt.executeQuery(q);
                }catch(SQLException sqle){sqle.printStackTrace();}
                if(!al) p.lock=false;
                return rs;
        }

I use this method only for queries that doesn't alter the db, instead
for updates I use :

public  synchronized void updateDB(String q )
        {
                boolean al=true;
                if(!p.lock){
                        p.lock=true;
                        al=false;
                }

                try {Statement stmt = conn.createStatement();
                        stmt.addBatch(q);
                        conn.setAutoCommit(false);
                        stmt.executeBatch();
                        conn.setAutoCommit(true);

                }catch(SQLException sqle){sqle.printStackTrace();}
                if(!al) p.lock=false;

        }


What should I do?

On 31 Mar, 13:39, Buff <[EMAIL PROTECTED]> wrote:
> CORRECTION: I am seeing this problem on v042 as well as v043. It was
> v037 I upgraded from that didn't have these errors.
>
> On Mar 31, 10:58 am, Buff <[EMAIL PROTECTED]> wrote:
>
> > I noticed a similar problem on v043 - same "SQLstatementsin
> >progress" error but it happens when I first make a connection to the
> > DB, not when doing an insert (it might also happen when doing inserts
> > but I haven't tested that yet). This problem did not occur for me in
> > v042 so it appears to be caused by the "multiple connections in Java
> > 6" changes for the pure Java driver. I haven't investigated this
> > problem any further yet so I'm afraid that's all I can add.
>
> > Sam
>
> > On Mar 28, 4:11 pm, magowiz <[EMAIL PROTECTED]> wrote:
>
> > > the same code using 036 works well
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to