[JBoss Seam] - @DataModelSelection behavior : bug or feature ?
by ve_rao
When does a variable annotated as @DataModelSelection get injected? Is it only when a row in the <h:dataTable> is selected? Or does it get initialized whenever there is a postback, even from a control outside the <h:dataTable>?
I am observing that in addition to the first case above, the second is also true. Even when an action listener is invoked in response to a link outside the <h:dataTable> element, the @DataModelSelection variable is getting initialized to the first element of the @DataModel.
Is my observation correct? Is that the expected behavior? That is causing unexpected behavior in my code. I am attaching my sources below to better illustrate.
Thanks,
-- venkat
<h:form>
|
| <s:link value="Up one level"
| rendered="#{folderNavigator.curFolder != null}"
| action="#{folderNavigator.upOneLevel}" />
|
| <h:dataTable var="folder" value="#{folderList}" >
| <h:column>
| <s:link value="#{folder.folderName}"
| action="#{folderNavigator.selectFolder}" />
| </h:column>
| </h:dataTable>
|
| </h:form>
In the listing above, "folderList" is a @DataModel, declared and used in the folderNavigator stateful session bean, which is given below:
@Stateful
| @Scope(SESSION)
| @Name("folderNavigator")
| public class FolderNavigatorAction implements FolderNavigator, Serializable
| {
| @DataModel
| private List<Folder> folderList;
|
| @DataModelSelection
| private Folder curFolder;
|
| @Factory("folderList")
| public void retrieveFolderList() {
|
| if (curFolder == null) {
| folderList = rootFolderList; // Initialized in constructor
| }
| else {
| folderList = curFolder.getChildFolders();
| }
| }
|
| public void selectFolder() {
| retrieveFolderList();
| }
|
| public void upOneLevel() {
| curFolder = curFolder.getParent();
| retrieveFolderList();
| }
| }
When the upOneLevel() method is called, curFolder is automatically injected with the first element of folderList, even though it was not invoked in response to a data model selection.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958418#3958418
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958418
19 years, 9 months
[Beginners Corner] - Re: JBoss goes down!
by jaikiran
anonymous wrote : while (rs.next()) {
| // Get integers, chars, strings, .....
| }
Are you sure that you are not invoking the rs.next() method again *inside* the while loop (Just to make sure that we are not missing anything). Usually the reason for the Exhausted resultset exception is that the user is trying to retrieve the contents of the resultset when it is empty.
It would be great, if you could post the exception stacktrace so that we could get more hints about the exception.
anonymous wrote : they told me that the JBoss is kept running but with no response at all
This means that the server is running but not responding. Usually in situations like these, it is very helpful to obtain the thread dump to see what exactly is going on the server in the background. The proceedure to obtain the thread dump is explained here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=StackTrace
Obtain the thread dump when the server becomes unresponsive. The thread dump will show you what operations are being carried out by each and every thread in JBoss.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958416#3958416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958416
19 years, 9 months
[Beginners Corner] - Re: JBoss goes down!
by nabieh
Dear Jaikiran,
Your reply is very appreciated, here you are the answers of your questions:
anonymous wrote : exceptions says: java.sql.SQLException: Exhausted Resultset
I have more than 12 exceptions in my DAOs, the whole DAO's works in the same behavior as shown in the following pseudocode:
| PreparedStatement ps = null;
| ResultSet rs = null;
| try {
| con = db.getConnection();
| String sql = "SELECT ....where id = ?";
| ps = con.prepareStatement(sql);
| ps.setInt(1, id);
| rs = ps.executeQuery();
| while (rs.next()) {
| // Get integers, chars, strings, .....
| }
| } catch (SQLException ex) {
| log.error("Exception ...", e);
| throw new DAOException("DAO Exception : ", e);
| }
|
| finally {
| try {
| if (rsGet != null)
| rsGet.close();
| } catch (SQLException e) {
| log.error("Error : ", e);
| }
| if (stmtGet != null) db.close(ps); /* db is a Serializable class where I close my connections and statements and it works very fine */
| db.closeConnection(con);
| }
|
I suggested to increase the Oracle cursers, does that make scense?
anonymous wrote : we are facing a strange behavior of the application server - JBoss, from time to time, it goes down and became unaccessible, and it seems that the application is not able to run any more
Dear, I have contacted my operation team and ask them about that, they told me that the JBoss is kept running but with no response at all, if you try to enter a web application it gives you the common 'Page not found' html page. I asked them also about the memory, the server has 2 GBs of memory, half of them assigned to the deployed application by setting that condition in the batch file for the java command within JBoss environemt.
anonymous wrote : Also, which version of JBoss are you using?
I contacted the operations, the JBoss version is 'JBoss 4.0.1SP1'
Your feedback will be very kind of you Jaikiran. Please feel free to ask any question you would like to.
Nabieh.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958411#3958411
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958411
19 years, 9 months