Correct me if i am wrong .
François Exertier wrote:
Hi Ritesh,As you said that i am doing the JDBC call to get the data .Ritesh wrote:
Hello ,I understand that you developed your own JDBC code in your bean (following the suggestion of Calvin). This warning means that, in a method performing JDBC calls, you did a "conn = dataSource.getConnection()", but you forgot to do a "conn.close()" at the end of the method. See http://www.objectweb.org/jonas/jonas_root/doc/Program.html#Writing to see how to develop JDBC code in EJB components (this rule also applies to Session beans). This is necessary for the server to manage the transactions, and this is not costly because this is a logical close, just indicating to the server that the connection is released, and can be put back in the pool. Not doing this close in your case is more expensive, since, as expressed in the trace message, the server has to close the physical connection !Please refer my previous mail subject: " How to improve the performance "
(Manufacurer /Make/ Model)
In that mail i explaned about the problem of bean getting called inside the Loop.
Now the problem becomes even worst .
Now i am having 21 Manu . 41 Makes , 382 Models
Because the findBy methods were not working properly
i removed them and put up the preparedstatements .
But now my whole system goes down .
For this method which is in session bean
For all the methods i removed the "Required" attribute for TransactionEven the method is not finished , i am getting error EJBserver.err.tracout
"""""""""""
Thread-0 : 7:40:10:206 WARNING: Connection not closed by caller
Thread-0 : 7:40:10:207 Force a physical close to avoid reusing it in another transaction""""""""""""""""""
The method which you descrbed is right i am doing by the same
Here I my code snippts
PreparedStatement preStmtManu = null;
PreparedStatement preStmtMake = null;
PreparedStatement preStmtModel = null;
PreparedStatement preStmtYear = null;
Connection conn = null;
PreparedStatement preAllMMMdetals = null;
try{
if (conn == null)
conn = connFactory.getConnection();
log("getMMMdetails: got connection ");
preStmtManu = conn.prepareStatement(" select distinct manufact_id , manufact_name
from "+
" vehicle_manufacturers ");
preStmtMake = conn.prepareStatement(" select distinct make_id , make_name
from "+
" vehicle_makes where manufact_id = ? ");
preStmtModel = conn.prepareStatement("select distinct model_id , model_name
from "+
" vehicle_models where make_id = ? ");
preStmtYear = conn.prepareStatement(" select distinct model_year from vehicle_model_years
"+
" where model_id = ?");
ResultSet rsetManu = preStmtManu.executeQuery(); //REsulr ser for the Manuifacturer
if (rsetManu != null ){
log("GetMMDetails:: the make query i prepared Now going to get the makes");
while(rsetManu.next()){
log("getMMdetails going for "+rsetManu.getString(2)+" Manufacturer ");
tMapManufact.put(rsetManu.getString(2),rsetManu.getString(1)); //Setting
Manufa treemap
preStmtMake.setInt(1,Integer.parseInt(rsetManu.getString(1)));
ResultSet rsetMake = preStmtMake.executeQuery(); // Results set for the
Make
while ( rsetMake.next()){
log("GetMMDetails:: the rest of the make is not null for the manufacturer"+
rsetManu.getString(2));
tMapManufactMake.put(rsetMake.getString(2),rsetManu.getString(1));
preStmtModel.setInt(1,Integer.parseInt(rsetMake.getString(1)));
ResultSet rsetModel = preStmtModel.executeQuery();// Result set for Model
while(rsetModel.next()){
preStmtYear.setInt(1,Integer.parseInt(rsetModel.getString(1)));
ResultSet rsetYear = preStmtYear.executeQuery();
while(rsetYear.next()){
log("GetMMdetails the for model->"+rsetModel.getString(2)+"->years are"+
rsetYear.getString(1));
tMapModel.put(rsetModel.getString(2)+"/"+rsetYear.getString(1),
rsetModel.getString(1));
tMapMakeModel.put(rsetModel.getString(2)+"/"+rsetYear.getString(1),
rsetModel.getString(1));
}
}
}
}
}
}
catch(Exception e){
log(getClass()+"| getMMMDetails() | Error : Could not set Data for MMMTreeMapJBean
"+e.toString());
} finally{
try{
if ( preStmtManu != null ) preStmtManu.close();
if ( preStmtMake != null ) preStmtMake.close();
if ( preStmtModel != null ) preStmtModel.close();
if ( preStmtYear != null ) preStmtYear.close();
if ( conn != null ) conn.close();
}catch ( java.sql.SQLException excExp ){
log("EXP::SQL-CondModel while clossing connection: "+excExp.toString());
//e.printStackTrace();
}
I think above is the anwser for your question for the "connection not
closed "
Can you explain where is the "micoding"
Because of this now i am not able to access rest of the the beans
Now my whole system goes down .I have to restart the apache and ejbserver then when i call the the same method it dies.
I am getting what exactly is happening .
Is this the problem of the JOnAS which could not process that much data
or somewhere i am going wrong
This problem is certainly due to the described above.
If i set the my isolation to default will it affect to my other entity beans ?All the above things are happening when the single user is acessing the site
I am wooried when 200 peoples will call the method at the same timeWhat are the optimal setting i have to do in jonas.properties or in oracle.peoperties,
What are the tx/transaction settings i have to do ?
Depends if you only read the data or also need to update it ...
Since JOnAS 2.3, transaction isolation is done by the container and does not rely anymore on the database. So if your database is only accessed by your JOnAS server, you can set the JDBC isolation level to access your database very low, thus avoiding useless database locking ... We still have not documented it, but the way to do it is very simple :
you set it in the datasource.properties file using the datasource.isolationlevel propertydatasource.isolationlevel default
possible values are: serializable, none, read_uncommitted, read_committed, repeatable_read, default
The principle of open source and more especially of this mailing list, is that everybody can contribute and help the others, and not only the "jonas team". So when a mail has already been answered by somebody else, and I think the answer you got from "Calvin Varney" <[EMAIL PROTECTED]> was particularly nice and clear, we do not take time to answer. Sorry for that.I am very furstated with this Probelem and for my Previous mail
I haven;t got any reply from the JOnas Team.
François ,I am Using the JOnAS 2.1.2 (on linux with RMI ) and oracle 8i (8.1.6) on solaris
Each is having 1 GB Ram
Jsp Are running with the Jserv 1.12 and Apache 1.3.12 (DSO support)
I have given 256 RAM to the JVM .
Regards
Ritesh
One more question , JOnAS which is running on single CPU
For the Same JOnAS to work on the Dual CPU machine , do ihave to make any changes into
the configuration .
Did any boody have tried JOnAS on dual CPU. ?
Regards
Best Regards,François
--
Ritesh.
==================================================================
François EXERTIER Evidian (Groupe Bull)
1, rue de Provence, BP 208, 38432 Echirolles cedex, FRANCE
mailto:[EMAIL PROTECTED]
http://www.evidian.com/jonas http://www.objectweb.org/jonas
Tel: +33 (0)4 76 29 71 51 - Fax: +33 (0)4 76 29 77 30
==================================================================
---- To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "unsubscribe jonas-users". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
