Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

4 pages of forms.......

Thread view: 
gbattine - 10 Aug 2006 23:17 GMT
Hi guys,
i've a question for you.
In my Jsf application i need to upload in a mysql database a genetic
experiment.
This experiment is made of 4 pages of forms that user has to compile.
I want to use transaction for suring that experiment was completely
updated (the experiment will be stored in 5 different tables).
How can i syncronize all the forms and update once the tables of mysql
db with all the experiment's data?
Can you help me with idea or examples?
Thanks very much
Moiristo - 11 Aug 2006 01:36 GMT
> Hi guys,
> i've a question for you.
[quoted text clipped - 7 lines]
> Can you help me with idea or examples?
> Thanks very much

I assume you know how to upload a file by now. First, make sure the
mysql database supports transactions (the default doesn't, I always use
InnoDB). To perform a transaction, you must do something like below. I
didn't copy/paste, so I might have forgotten some things.

conn.setAutoCommit(false);
try {
    conn.execute(query1);
    conn.execute(query2);
    conn.commit();
} catch( (SQL)Exception e) { conn.rollback(); }

The only problem I have (maybe you or someone else knows a solution), is
that I have I database with an auto_increment field. I need to insert
some data in one table, fetch the id from the increment field and use
this id for some other inserts (all within the same transaction). It
causes a deadlock.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.