When I run the two C programs using

      rc = sqlite3_busy_timeout(db, 1000);
      if ( rc != SQLITE_OK ) {
                fprintf(stderr, "SQL error: sqlite3_busy_timeout
failed.\n");
                exit(0);
      }

everything works perfectly.  No sqlite busy erros or table locked.

But, when I to do this using a java app using the following the code
doesn't work.  Basically, config.setBusyTimeout() doesn't seem to be
working as I anticipated --  see below.   Can you advise?

Thanks, Jay

Class.forName("org.sqlite.JDBC");
String s = "jdbc:sqlite:"+db;

config = new SQLiteConfig();
config.setBusyTimeout("100");
conn = DriverManager.getConnection(s, config.toProperties());
conn.setAutoCommit(false);
stmt = conn.createStatement();

On Wed, Dec 7, 2016 at 4:17 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 7 Dec 2016, at 11:28pm, Jay Weinstein <jpwe...@gmail.com> wrote:
>
> > Is it correct to say busy timeout will work for two separate processes
> and
> > I don't have use fork in C/C++ or ProcessBuilder in java to execute one
> as
> > a child and a parent?
>
> The timeout setting is attached to the database connection.  If you
> execute _open() twice you need to set it once for each connection.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to