[JBoss Seam] - Re: Form submit trigger many updates
by hstang
Using a TransactionalSeamPhaseListener:
A non JSF request (a redirect for example)--transaction begins just before restore_view(rv) phase, and the same transaction commits just after rv. A second transaction begins before render response phase (rr), and commits after it.
For a JSF request(e.g. submit)--tx begins just before rv phase, and commits just after invoke application phase (after completion of your action method). Similarly to non jsf request, a second transaction begins before rr phase, and commits after.
That's why there isn't need to do explicit flush. If you really want to do that though, you can look into using atomic conversations. Set the flushModeType to manual, then Seam will only flush when you tell it to. The docs should have more about it. Good luck.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997766#3997766
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997766
19 years, 3 months
[Installation, Configuration & Deployment] - JBoss-App configuration.
by narsibvl
We are in the processing of upgrading to JBoss AS 4.0.5 from one of the older versions. I dropped in an existing jboss-app.xml file from the older version into the /deploy directory of 4.0.5 and it crashes on startup.
The error i am getting is
org.jboss.deployment.DeploymentException: Invalid XML: file=META-INF/jboss-app.xml; - nested throwable: (org.xml.sax.SAXParseException: The content of element type "module" must match "((ejb|java|web),alt-dd?)".)
Here is a sample code from my jboss-app.xml.
<jboss-app>
<.module>
<.ejb>Core.jar</.ejb>
<external-path> C:/ormStream31/Server/EJB/Core.jar
</external-path>
</.module>
<.module>
<.web>
<web-uri>EDS.war</web-uri>
<context-root>EDS</context-root>
</.web>
<external-path> C:/FormStream31/Server/webapps/EDS.war
</external-path>
</.module>
</jboss-app>
(The periods are only to make sure the tags show up and they are not the problem)
Obviously the dtd for jBoss-app has changed since the older version we were using and looks like the new dtd doesn't like the <external-path>.
Now, how does one go about configuring the jar and war files in 4.05 ?
Where do you specify the external-path ?
Can some one point me to a sample jboss-app that uses jar and war files in 4.0.5
Thanks
Narsi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997765#3997765
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997765
19 years, 3 months
[Persistence, JBoss/CMP, Hibernate, Database] - Need help on converting SQL to EJB QL
by scout1lacno
Hi all,
Im having problems with my EJB QL statements. Im using MySQL as my database..
The SQL statement below works perfectly on MySQL:
| select o.dateArrived, o.custName , o.IDCategory
| from tblMessages AS o WHERE o.IDCategory = "+categoryId+" and DATE_SUB( '"+dateReceived+"' , INTERVAL 2 DAY ) <= o.datArrived ORDER BY o.datArrived DESC
When transfered the statements to my facade:
| public List getData(String categoryId, String dateReceived){
|
| return em.createQuery
| ("select o.dateArrived, o.custName , o.IDCategory"+
| "from TblMessages AS o WHERE o.IDCategory = "+categoryId+" and "+
| "and DATE_SUB( '"+dateReceived+"' , INTERVAL 2 DAY ) <= o.dateArrived,
| ORDER BY o.datReceived DESC").getResultList();
|
| }
It produce an exception: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: 2
Any suggestions?
Thanks. :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997761#3997761
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997761
19 years, 3 months
[JBoss Seam] - Form submit trigger many updates
by milesif
Hi everybody,
I have a class based on the "Seam APplication Framework" defined as
| @Name("machineHome")
| class MachineHome extends EntityHome<Machine>
|
I submit a form whose fields are bound to variables of type
| #{machineHome.instance.fieldName}
|
calling the action (I overrid the method just to play with exceptions)
| @Override
| @Transactional
| public String update()
| {
| try {
| getEntityManager().joinTransaction();
| getEntityManager().flush();
| updatedMessage();
| return "updated";
| } catch (Exception e) {
| e.printStackTrace();
| return "";
| }
| }
|
When I submit the form I see the following log message
| 00:32:57,454 INFO [STDOUT] Hibernate: update public.machines set version=?, start_date=?, status=?, id_unit=?, machine_code=?, purchase_date=?, last_maintenance_date=?, dismission_date=?, expected_life=?, id_machine_type=?, maintenance_category=? where id_machine=?
|
I see it as many times as the number of fields I modified before submitting the form.
This happens if in faces-config.xml I set
| <lifecycle>
| <phase-listener>
| org.jboss.seam.jsf.SeamPhaseListener
| </phase-listener>
| </lifecycle>
|
while it does not happen if I set
| <lifecycle>
| <phase-listener>
| org.jboss.seam.jsf.TransactionalSeamPhaseListener
| </phase-listener>
| </lifecycle>
|
In both cases the entity manager get flushed (and the changes saved) even if I do not call flush() explicitely and when I call a method that is not tagged as @Transactional.
Can anybody help me to understand why that happens and how to flush the entity manager only when I call flush explicitely? Should I use a @Stateful session bean ?
Thanks to anybody for help.
Ciao Francesco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997760#3997760
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997760
19 years, 3 months
[JBoss Eclipse IDE (users)] - Adding Source and Javadoc to JBoss-IDE Libraries
by flindet
Hi,
Is there any way to add source code and javadoc to the JBoss-IDE provided libraries? I'd like to do this because I find the Javadoc access from within Eclipse to be very helpful, and I'd like to be able to walk into the source when debugging applications.
To demonstrate my problem, I right-click on my project, select Properties | Java Build Path | Libraries. I expand JBoss EJB3 Libraries and expand any of the jars (hibernate3.jar for example).
Here is where I would normally be able to attach the source code and the Javadoc that is associated with the library. However, in the case of JBoss-IDE libraries, it states that the library is non-modifiable and the Edit button is grayed out.
Can JBoss-IDE be modified to allow the attachment of source code and Javadoc? If not, can you please include the source code and Javadoc so that they are accessible within Eclipse?
I'm currently using JBoss-IDE 2.0.0 Beta 2, but I've seen this behavior with older versions as well. I tried looking through the JBoss-IDE FAQ and didn't notice this addressed. Forgive me if this is mentioned elsewhere. If someone can point me in the right direction, it would be greatly appreciated.
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997759#3997759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997759
19 years, 3 months