Database Transaction not worked in MySQL

I work on java project. It accesses MySQL database and is deployed in Jboss 7. I need to implement the database transaction inside the project. Event though I modified java code, it was not worked. I looked into Jboss 7 changes, related to database transaction and could not find the any changes.

Then I developed a sample java project that accesses the MySQL database. It is deployed in Jboss 7. Database was created, using XAMPP. By default, it set InnoDB as database engine. It worked properly. Whilst testing on that project, I changed the database engine to MyISAM. Here, I could notice, database transaction did not work.

With that perception, I searched on database engines in MySQL. It gives the better conclusion. MySQL uses two major database engines. Those are InnoDB and MyISAM. They have considerable major changes. One of them is based on database transaction. InnoDB supports transaction and MyISAM does not.

Again, I back to the real project. Its database used two types of engines. Initial database is built with InnoDB. Later, one of team member of made some changes for few tables. Those engine has been set MyISAM. Therefore, the real project does not perform the database transactions. These modifications has been made on the  earlier version of MySQL. Therefore it set the MyISAM for engine.

By default, the newer version of MySQL sets InnoDB as the database engine. Earlier versions sets MyISAM database.

වියපත් තොටියා

නුඹෙ තාම යෞවනය
යයි මා හා සිනා සලා
මා මෙතන වියපත්ව
හිදිමි ඔබ දෙසම බලා

මවා දිය රැලි පෙලි
මතකයේ මවාලා
වාරු වූ අතැගිලි
හබලටම ගෙවීලා

මා ගත ද වැහැරි
ඔරු කදත් දිරාලා
අදුර ගලද්දී
උලලේනා හඩාලා

Transaction Error in Jboss 5.1

I wanted to deploy a web project on Jboss 5.1, which was deployed in Jboss 4.0 successfully. I could deploy the project in Jboss 5.1 properly but it gives following user transaction error whilst executing.


12:06:47,640 ERROR [STDERR] java.lang.ClassCastException: org.jboss.tm.usertx.cl
ient.ServerVMClientUserTransaction cannot be cast to javax.transaction.UserTrans
action (more…)

Generating SQLite database using sqlite3

sqlite3 is simple command line utility. After running with command line, user can create the database file with preferred name. Then user can use SQL command to manage the database.

Installing

Download link: http://www.sqlite.org/download.html
Eg: For Windows user, use the following “Precompiled Binaries For Windows” link.

1. Download is a compressed file.  After extract it and select the sqlite3.exe file inside the extracted directory. Then save it.

Eg: I used directory “sqlite” inside the C partition:
C:\sqlite

2. Open the command prompt and goto to the derectory

Eg: command
cd c:\sqlite

Creating Database

1. Enter command “sqlite3 <database_file_name>”.

Eg: Following command to create the helloworld database
sqlite3 HelloWorld.db

2. Then command prompt will show as following.

SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

3. Then use the SQL command to create the tables and populating tables.

Eg: SQL command to create a table
sqlite>create table tbl1(one varchar(10), two smallint);

4. After completed data insertion, use “.exit” command to exit the sqlite3.

Eg: Command
sqlite> .exit

For more information, please refer http://www.sqlite.org/sqlite.html

SQLite

SQLite is an ACID-compliant embedded relational database management system contained in a small C programming library.

It is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.