Comments (6)
I could be mistaken, but are you sure that the page rendering is multi-threaded? The only potential problem that I can see is if someone tries to load two pages at once.
from senecabbb.
I think the problem happens before the rendering occurs. Looking at the exception and stack trace, my understanding of what happens is this:
(Line Numbers referece https://github.com/SenecaCDOT-BigBlueButton/SenecaBBB/blob/master/web-app/src/db/DBAccess.java)
Thread 1: Line 112 executes, and returns a result set with 5 columns (let's say), and assigns it to '_rs'.
Thread 1: Line 113 executes, returns a column count of 5 (DB column counts use base 1 arrays), assigning it to its 'colCount'.
THREAD SWITCH HAPPENS!
Thread 2: Line 112 executes, and returns a result set with 3 columns (let's say). Since the result set variable '_rs' is a shared variable (since both threads are on the same instance of DBAccess), the old result set from thread 1 is overwritten.
... more stuff happens in thread 2, and then
THREAD SWITCH HAPPENS!
Thread 1: Goes about it's business, until it gets to line 117. Then, its colCount is still 5, but its iterating over records with only 3 rows of data (from thread 2). In addition to iterating of the wrong result set, when '_rs.getString(i)' happens with values greater than 3, a null pointer exception is thrown.
Again, because there are so few records in the databases, the queries generally happen quickly, so this is hard to replicate, but with more records it might be easier to see.
from senecabbb.
By "page rendering" I meant the step where the JSP file is turned into an HTML page before being sent to the user. I'm pretty sure each page only has one thread because the JSP file runs sequentially. There's a threading issue if more than one page is loaded at the same time because each will access the database, but if you were just loading one at a time I don't think threads are the cause of your exception.
from senecabbb.
You are right that JSP scriptlets each have there own thread, but the DBAccess class is session-scoped, meaning that it can be shared by multiple requests that belong to the same session.
After looking around some more, I am sure that I am right. I tested it by causing the DBAccess to wait for some period of time after each row was parsed, making it more likely that the threads for each request would get switched out, and trip each other up. It consistently reproduced the error. After making the variables local, or synchronizing the method, the problem disappeared. I will push my fix.
from senecabbb.
Hello Adam,
I am also facing similar problem.
Could you kindly help me to understand and fix the issue with below details
- I have db helper class where static getdbconnection method is defined.
- All the methods in db helper class is static.
- All the db query methods are defined in this class which will be called by Servlets.
After making the variables local, or synchronizing the method, the problem disappeared.
which variables you have made local and which method you have made synchronized?
from senecabbb.
Hello Adam,
Got the fix.
PreparedStatement, dbConnection and Resultset all changed to local variable for methods and my application works without any issues.
from senecabbb.
Related Issues (20)
- Change the label "Create Meeting" to "Start Meeting"
- Correct the error message of clicking inactive Join Meeting button.
- Add "BigBlueButton Conference Manager" after Seneca logo on the top of the page
- The footnote in IE appears at right side of the screen HOT 1
- change the automatic email system to use authenticated email account HOT 2
- Add a timer option to the message display HOT 2
- Internal server error when starting a new meeting from chrome HOT 1
- Email a person after they are added to a meeting schedule HOT 1
- Modify Event information not loaded properly
- Add capability to post notifications on login page.
- Name and Last name does not accept spaces
- Automated Invitation Email has bad message for guests
- There's no UI for viewing or modifying the record meeting setting HOT 2
- The language for adding a user as attendee/guest is confusing
- LDAP Expired Password can login bbbman
- Add Favicon to title bar
- UI broken HOT 1
- Recordings viewable for meeting that was never started HOT 1
- Apply the name newbbb.googool.com to new server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from senecabbb.