Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
Update not seen with transaction isolationlevel read-committed
Rob Gansevles
2011-12-05 08:29:18.0
Hi,

I have a new issue, an update followed by a select does not show the updated data.

I have a little java program that shows the issue, see below.
The result in the program should be 1, but 0 is returned.

When the line with the call to connection.setTransactionIsolation() is commented out, it works as expected (note that all is done on just single connection).

Thanks in advance,

Rob Gansevles


public static void main(String[] args) throws Exception
{
Class.forName("com.hxtt.sql.dbf.DBFDriver");
java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:dbf:////tmp/test_hxtt_dbf?lockType=VFP", "", "");

// NOTE: when transaction isolation is not set, the test works OK!
connection.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_COMMITTED);

try
{
exec(connection, "drop table tst");
}
catch (Exception e)
{
}
exec(connection, "create table tst (tst_id integer not null, tst_f integer null, primary key (tst_id))");

exec(connection, "insert into tst (tst_id, tst_f) values (1,0)");
exec(connection, "insert into tst (tst_id, tst_f) values (2,null)");


exec(connection, "update tst set tst_f=1 where tst_id in (SELECT tst_id FROM tst WHERE tst_f != 1 OR tst_f IS NULL)");

java.sql.Statement s = connection.createStatement();
java.sql.ResultSet rs = s.executeQuery("select tst_f from tst order by tst_id asc");
rs.next();
System.out.println("expecting 1, getting " + rs.getInt("tst_f"));

rs.close();
s.close();
connection.close();
}

public static int exec(java.sql.Connection connection, String sql) throws Exception
{
java.sql.PreparedStatement ps = null;
try
{
ps = connection.prepareStatement(sql);
return ps.executeUpdate();
}
finally
{
if (ps != null) ps.close();
}
}
}
Re:Update not seen with transaction isolationlevel read-committed
HXTT Support
2011-12-06 00:14:06.0
Thanks. Similar new code cache issue for tranasaction. Fixed. Please download the latest package.
Re:Re:Update not seen with transaction isolationlevel read-committed
Rob Gansevles
2011-12-06 01:35:38.0
Works, thanks again.


Rob

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap