[EJB 3.0] - Re: Create timer -
by obfuscator
"adenzo" wrote : Hi,
| Any further info on this?
| I had similar trouble, and in the end got it working by making a seperate call, i.e.:
| JSF ManagedBean -> A:doSomething();
| JSF ManagedBean -> B:makeTime();
|
| Then making timers worked, as long as I did not EJB work within B.
| This was on 4.2.0.CR2
| Having other issues like this regarding using a @Resource injected JDBC connection also.
|
Yeah, I think it's some sort of "bug" that has to do with accessing different data sources within the same transaction, although I'm not sure. Seems like the transaction craps up since i was trying to persist entities and create timers in the same transaction. Is this what you're getting to? I guess that's pretty logical if you think about it...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048906#4048906
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048906
18 years, 11 months
[JBoss Seam] - weird problem
by cormet
Hi All,
I have following problem in calling action on datatable. here are the code:
| <h:form>
| <h:commandButton action="#{accountAction.selectAccount}" value="test" />
| <rich:dataTable
| onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
| onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
| cellpadding="0" cellspacing="0"
| columnsWidth="0px, 0px, 0px"
| border="0" var="_account" value="#{accountList}">
| <rich:column>
| <f:facet name="header">
| <h:outputText value="Account #" />
| </f:facet>
| <h:commandButton id="select" action="#{accountAction.selectAccount}" value="#{_account.account.display}" />
| </rich:column>
| <rich:column>
| <f:facet name="header">
| <h:outputText value="Name" />
| </f:facet>
| <h:outputText value="#{_account.account.name}" />
| </rich:column>
| <rich:column>
| <f:facet name="header">
| <h:outputText value="Type" />
| </f:facet>
| <h:outputText value="#{_account.account.accountType.title}" />
| </rich:column>
| </rich:dataTable>
| </h:form>
|
| public String selectAccount() {
| log.debug("selectAccount() :: selected account id ");
| return null;
| }
|
the code above has button called "test" and it is get called from test button.
however, if i click from one of the button in my datatable, the action method does not get call at all.....
what has hapeenning in here???? i feel weird and does not work in stable enviroment of jsf....Can some one tell me what i have made mistake ????
it is quite stress when encounter this error (could be my bad)...
Cheer,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048885#4048885
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048885
18 years, 11 months
[JBoss Seam] - Re: Domain model duplicates validation
by fernando_jmt
I don't know what exactly you mean with "without mapping that to the database", but anyway I have solved something similar as follows:
| @Entity
| @Table(name = "person", uniqueConstraints = @UniqueConstraint(columnNames = {"firstname", "lastname"}))
| public class Person {
| @Id
| private Long id;
| @Column(name = "firstname")
| private String firstName;
| @Column(name = "lastname")
| private String lastName;
| private String address;
|
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
| public String getFirstName() {
| return firstName;
| }
|
| public void setFirstName(String firstName) {
| this.firstName = firstName;
| }
|
| public String getLastName() {
| return lastName;
| }
|
| public void setLastName(String lastName) {
| this.lastName = lastName;
| }
|
| public String getAddress() {
| return address;
| }
|
| public void setAddress(String address) {
| this.address = address;
| }
| }
|
|
With above, the validation is done in database layer, but it is caught by JPA and it throws a javax.persistence.EntityExistsException. It works for me in the sense I don't have to write any special login in a Session Bean to validate this.
HTH.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048884#4048884
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048884
18 years, 11 months