[JBossCache] - Re: JBossCache with Hibernate on Glassfish v2
by eric.hubert
"genman" wrote : I must admire your chutzpah coming on to the JBoss message boards asking how to port your EJB3 application to Glassfish.
|
genman, thanks for your quick reply. Although unfortunately it doesn't help me much. I could succesfully deploy the application to Glassfish using hibernate and ehcache. I only would like to replace ehcache with JBoss Cache on Glassfish. That's why I decided to ask in the JBoss Cache forum.
I also must admit I can't see any chutzpah on my side. I know the JBoss people as very open-minded and technical interessted. From my point of view Hibernate and JBoss Cache are application server independend projects and should be treated as such. Am I wrong?
My aim is to get our JEE applications independent of the application server used - at least were it is technical feasible with a reasonalbe expenditure. Personally, I like JBoss AS very much and would like to use Glassfish v2 only during the development process as a reference implementation to doublecheck compliance to the spec. In some areas JBoss offers some non-standard temperings which decrease portability if one makes happily use of them. It could also be very practical to help isolating issues.
So again I see no problem asking the JBoss folks for their support and hope that they will have a similar view on this topic than I do.
Regards,
Eric
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106209#4106209
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106209
18 years, 8 months
[JBossCache] - Clusted Cache with Berkeley CacheLoader with a singleton wri
by jivesociety
I was wondering if a configuration with the following properties is possible:
- clusted cache
- Berkeley CacheLoader
- Singleton writer enabled
I'm getting the following exception and was wondering if there was a way to make this work out of the box without creating a custom cacheloader.
Caused by: com.sleepycat.je.log.LogException: (JE 3.2.44) A je.lck file exists in C:\cache\stats The environment can not be locked for single writer access.
at com.sleepycat.je.log.FileManager.lockEnvironment(FileManager.java:1292)
at com.sleepycat.je.log.FileManager.(FileManager.java:185)
at com.sleepycat.je.dbi.EnvironmentImpl.(EnvironmentImpl.java:296)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:102)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:54)
at com.sleepycat.je.Environment.(Environment.java:100)
at org.jboss.cache.loader.bdbje.BdbjeCacheLoader.start(BdbjeCacheLoader.java:171)
at org.jboss.cache.loader.AbstractDelegatingCacheLoader.start(AbstractDelegatingCacheLoader.java:158)
at org.jboss.cache.loader.CacheLoaderManager.startCacheLoader(CacheLoaderManager.java:378)
... 61 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106208#4106208
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106208
18 years, 8 months
[Persistence, JBoss/CMP, Hibernate, Database] - How remove an element from a list?
by ByDcc
Hello,
I am trying to remove and element from a list but I don't get it.
I have a category and details for this category.
Relevant code for Category:
@Entity
| @Table(name = "category", catalog = "CartStore", uniqueConstraints = {})
| public class Category implements java.io.Serializable {
| // Fields
| private long id;
| private String name;
| private String description;
| private String sortDescripcion;
| private Long creatorId;
| private Date creationDate;
| private Date modificationDate;
| private CategoryContext categoryContext = null;
| ...
| @Id @GeneratedValue
| @Column(name = "id", unique = true, nullable = false, insertable = true, updatable = false)
| public long getId() {
| return this.id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
| ....
| @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "category")
| public Set<CategoryDetails> getCategoryDetailses() {
| return this.categoryDetailses;
| }
|
| public void setCategoryDetailses(Set<CategoryDetails> categoryDetailses) {
| this.categoryDetailses = categoryDetailses;
| }
Relevant code for CategoryDetail:
@Entity
| @Table(name = "category_details", catalog = "CartStore", uniqueConstraints = {})
| public class CategoryDetails implements java.io.Serializable {
| // Fields
| private long id;
| private Category category;
| private String name;
| private String value;
| private String type;
| ....
| @Id @GeneratedValue
| @Column(name = "id", unique = true, nullable = false, insertable = true, updatable = false)
| public long getId() {
| return this.id;
| }
|
| public void setId(long id) {
| this.id = id;
| }
| .....
| @ManyToOne(cascade = {}, fetch = FetchType.LAZY)
| @JoinColumn(name = "category_id", unique = false, nullable = false, insertable = true, updatable = false)
| public Category getCategory() {
| return this.category;
| }
|
| public void setCategory(Category category) {
| this.category = category;
| }
The code I run:
tm.begin();
| CategoryDetails categoryDetail = em.find(CategoryDetails.class, idCategoryDetail);
| categoryDetail.setName("To remove");
| Category category = categoryDetail.getCategory();
| Set categoryDetails = category.getCategoryDetailses();
| for(Iterator it = categoryDetails.iterator(); it.hasNext();) {
| CategoryDetails cdx = (CategoryDetails)it.next();
| cdx.getId(); // Lazy
| }
| categoryDetails.remove(categoryDetail);
| categoryDetail.setCategory(null);
| category.setCategoryDetailses(categoryDetails);
| em.merge(category);
| tm.commit();
The element is not removed and sentece sql that I see is:
2007-11-20 00:02:54,375 [main] DEBUG org.hibernate.SQL -
| update
| CartStore.category_details
| set
| name=?,
| value=?,
| type=?
| where
| id=?
| Hibernate:
| update
| CartStore.category_details
| set
| name=?,
| value=?,
| type=?
| where
| id=?
What i am doing bad?
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106201#4106201
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106201
18 years, 8 months
[JBoss Seam] - submitting a dataTable/dataModel via modalPanel
by asookazian
is it possible to do this?
I relocated the submit button from each row of the @DataModel @Factory driven h:dataTable in my xhtml to the a4j:form in a rich:modalPanel.
Now I'm realizing that the way it was working before was the submit buttons were posting the user inputted data from the xhtml to the SFSB.
My main question is: in order for the "latest" user entered data to be available in the backing SFSB when user submits, must you have the submit button embedded in the dataTable form or can you somehow achieve propagation and subsequent persistence from a4j:form in modalPanel?
Use case is basically having the submit/cancel buttons display in modalPanel after user clicks on all 3 radio buttons in a particular row.
I'm not sure how to pass the currentRow param to the submit method on the SFSB b/c the value of myAuditList.getRowIndex() = -1 in the submit method in SFSB. So I was looking into Seam remoting to set the currentRowNum of the dataTable in the SFSB instance variable. Not only that, I'm not sure how to "inject" the latest data from dataTable into submit method via modalPanel submission. It seems that is part of the Seam magic.
| <h:dataTable id="dataTable1" value="#{myAuditList}"
|
| <rich:modalPanel id="mpEmployeeSubmit" minHeight="200" minWidth="450"
| height="500" width="500" zindex="2000">
|
| <f:facet name="header">
| <a4j:form id="a4jHeaderForm2">
| <h:outputText id="headerText2" value=""/>
| </a4j:form>
| </f:facet>
|
| <a4j:form id="a4jMainForm2">
| <h:panelGrid columns="2" style="vertical-align:middle">
| <h:outputText id="description2" value=""/>
| <BR/>
|
| <!-- hidden variables are null/empty in NoteAction submit method, using Seam remoting -->
|
| <h:inputHidden id="rowIndex2" value="noteAction.rowIndex"/>
| <h:inputHidden id="colName2" value="noteAction.colName"/>
|
| <a4j:commandButton value="submit" action="#{securityAuditAction.submit}" onclick="Richfaces.hideModalPanel('mpEmployeeSubmit')"/>
|
| <BR/>
| <a4j:commandButton value="cancel" onclick="Richfaces.hideModalPanel('mpEmployeeSubmit');unselectCurrentRadioButton()"/>
|
| </h:panelGrid>
| </a4j:form>
| </rich:modalPanel>
Perhaps you must have hidden submit buttons per row in addition to the modalPanel submit buttons and when the user clicks the submit button on the modalPanel, an onclick event handler "clicks" the submit button for the appropriate row in the dataTable form.
would that work or is there a better way? thx.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106199#4106199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106199
18 years, 8 months