Hi everyone,

First I want to thank to all, that helped me in previous problems and that
helped other people, solving there problems ... because ... one of those
problems can be one of mine in the future.

I want to make a web page that allows people insert and update information.

The problem that I'm having is with the update version.
The database I'm using is from ORACLE 8i.

I'm using the following statement:
stmt2.execute("select * from JSP_TESTS where employee_id = '"+person+"'");
ResultSet ds2 = stmt2.getResultSet();

With the above select, two person's can update the same record.
This is the problem that I want to avoid.

So my problem is with Lock's.

To solve the problem, I tried the following statement:
stmt2.execute("select * from JSP_TESTS where employee_id = '"+person+"' for
update");
ResultSet ds2 = stmt2.getResultSet();

With this select, other person shouldn't be able to edit the information, as
it is
locked to other.

But it returns an error:
Exception: java.sql.SQLException: ORA-01002: fetch out of sequence


Then, I used the following statement in SQL Navigator (from Quest Software):
select * from JSP_TESTS where employee_id = 2 for update

With the above select, the record was locked.

Then I ran my JSP, containing the same statement above:
stmt2.execute("select * from JSP_TESTS where employee_id = '"+person+"' for
update");

And ... the page were waiting, and waiting ...
When I pressed the COMMIT button (unlocking the record) in the SQL
Navigator, the jsp returned the same error:
Exception: java.sql.SQLException: ORA-01002: fetch out of sequence

Does anyone have experience in this field.

Thanks in advance,
José Castro

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to