Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT DB Exception(java.sql.SQLException: database is locked While using SWT)
SWT DB Exception [message #982177] Tue, 13 November 2012 01:02
Prashant p is currently offline Prashant pFriend
Messages: 57
Registered: October 2012
I am trying to connect SWT/Jface datadinding to DB through ibatis implementation.

I am getting below exception whenever i try to do insert or delete operation from client side (SWT).

### Error committing transaction. Cause: java.sql.SQLException: database is locked

This doesn't happen when i try to hit DB (SQLite) through ibatis directly.

Below is the code section for delete operation i am doing with SWT button and trying to delete SWT table row.

SWT Code....

btnDeleteWorkspaceRow.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) m_workplaceViewer.getSelection();
WorkplaceDetail workplaceDetail = (WorkplaceDetail) selection.getFirstElement();
boolean confirm = MessageDialog.openConfirm(shell, "Confirm Delete", "Are you sure you want to delete row"+ + workplaceDetail.getCode() + "'?");
if (confirm) {

**int code =186;** (Hardcoded row value- actual DB row number)
WorkplaceDaoImpl workplaceDaoImpl = new WorkplaceDaoImpl();

try {
} catch (SQLException e1) {

This is Ibatis DAO implementation code which i am invoking in SWT


public void deleteWorkplaceDetail(int code)
throws SQLException {
SqlSession session = sqlSessionFactory.openSession();
session.delete("WorkplaceDetail.deleteWorkplaceById", code);

**Ibatis Configuration**

<delete id="deleteWorkplaceById">
delete from Workplace where workplaceCode=#{code}

Please help me to resolve this issue. I am using SQLite DB
Previous Topic:Problem with Flash object in SWT Browser
Next Topic:Drawing Artifacts on UI space
Goto Forum:

Current Time: Fri Oct 09 10:36:26 GMT 2015

Powered by FUDForum. Page generated in 0.01521 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software