Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WELD-000315: Failed to acquire conversation lock

Status
Not open for further replies.

fayevalentine

Programmer
Jun 2, 2004
38
0
0
MX
Hello, everyone, I hope you have the patient to read my problem.
Any advice would be greatly appreciated, thanks in advance.

I want to create a report in a java web application with primefaces, deployed in Glassfish v4.0,
I use poi-3.10 library to write to Excel File.
My query is very simple but has six UNION instructions, also have INNER JOIN with four tables
and LEFT join with other four tables, that make 8 tables where I get data.

So instead of making the query with (because it takes so long):

WHERE (e.dt_creation >= TRUNC (TO_DATE ('Initial Date','dd/mm/yyyy'))
AND e.dt_creation < TRUNC (TO_DATE ('Final Date','dd/mm/yyyy'))+1)

I do one query for each day using:

WHERE e.dt_creation = TO_DATE ('Every Day','dd/mm/yyyy')

After trying to run the code for one year I get the error:

WARN: WELD-000315: Failed to acquire conversation lock in 1,000 ms for Transient conversation

Looking for the error I found:

"apparently in your case, there's an existing request holding the lock for a relatively long time,
while another parallel request is executed under the same conversation."

But I do not fully understand what I have to check or how,
If you can help me with this o tell me about some documentation I would by deeply grateful,
because sincerely from this point I am lost.
testing from a console application the code works fine and one year period takes about 2 hours and half to create the excel file.
But can't get the code to work in web application.

my code is something like this:

Java:
	String query = "SELECT something FROM some_tables WHERE some_date = 'b_date' ";  --just for example

    try (Statement stmt = con.createStatement()) {
		while (InitialCalendar.getTime().compareTo(FinalDate) <= 0 )
		{
		    --Here I replace date in query string so I can query the next day.
			
			try(ResultSet rs = stmt.executeQuery(qry))
			{
				if (!rs.isBeforeFirst() ) { 
				  --Write in Excel file there were no register this date
				}
				else
				{
					while (rs.next()) {
						 --Here I write all rows from ResulSet to Excel File, there are 26 columns 
					}
				}
			}
			InitialCalendar.add(Calendar.DATE, 1); --Add one day to calendar
		}
		 
		--After all I write all content to File
		wb.write("Excel_File.xlsx");

    } catch (SQLException e) {
        --handle the exception
    }


Regards.
Bruce

 
I don't think it has tod do with SQL, but with the way the action is invoked. Maybe this helps

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top