[JBoss Portal] - JCR CMS Repository on distant machine
by Antoine_h
Hello,
I would like to have an instance of JBPortal run on Machine A (dev), working with the CMS Repository that is on Machine B (pre-prod).
Only one repository, for both machines.
(using the repository with the filesystem persistence, but I can use a database if it is necessary)
How to do it : clues, idea ?
I guess : the JCR is base on JackRabbit and JMX service, so it must be possible to do it.
My question is : how, tricks, drawbacks etc....
some help to do it quickly, without searching all the doc of JackRabbit, thinking of how to do it with the JMX services etc...
shall I use the same JMX service (CMS) on Mach B, and call it from mach A ?
(is this possible ? clues ? how to configure the descriptor)
use two CMS JMX service on both machines, that work on the same filesystem of JCR persistence ?
(conflicts in concurrent access to the same file?)
well, any clue, where to look in documentation, etc... would help (and save time...)
and may be usefull for others...
Thank you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981512#3981512
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981512
19 years, 6 months
[Management, JMX/JBoss] - Re: persist & auto-restart mbean
by cnsxxx09
It didn't work (running store() method), but I guess that when I do get all this working the load and store are done automatically by JBoss since I set a Persistence Manager in my descriptor ...
"XMBeans .. can specify a PersistenceManager (PM) that is used during XMBean instantiation to load any attributes previously saved, and during normal operation to save attributes, based on the chosen Persistence Policy."
Looking further into the documentation, and in particular comparing MBean XML descriptors to XMBean ones, I see that you need to specify a section of attributes. Presumably the PM uses this to know what to store or not.
If I'm right, I just need to learn how to add this into my code and then .. fingers crossed, it should work ...
(Of course, I still have the issue of wanting my instantiated XMBeans to restart when JBoss restarts ... but I'll save that for another post ...).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981511#3981511
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981511
19 years, 6 months
[Persistence, JBoss/CMP, Hibernate, Database] - Optimistic locking with Hibernate and JCache
by kresho
Hibernate 3.1, Jboss 4.0.3SP1
I'm trying to get optimistic locking to work, but with no luck.
I'm using Jboss cache 1.4. Configuration of cache and session factory:
<server>
| <mbean code="org.jboss.cache.TreeCache" name="jboss.har:service=HarSecondLevelCache">
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
| <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_">
| <attribute name="maxNodes">50000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| <!-- Maximum time an object is kept in cache regardless of idle time -->
| <attribute name="maxAgeSeconds">600</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Chip_HB_LOCAL">
| <attribute name="DatasourceName">java:/jdbc/ChipDS_LOCAL</attribute>
| <attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
| <attribute name="SessionFactoryName">java:/hibernate/ChipHB_LOCAL</attribute>
| <attribute name="CacheProviderClass">org.jboss.hibernate.cache.DeployedTreeCacheProvider</attribute>
| <attribute name="DeployedTreeCacheObjectName">jboss.har:service=HarSecondLevelCache</attribute>
| <attribute name="ReflectionOptimizationEnabled">false</attribute>
| <attribute name="MaxFetchDepth">1</attribute>
| <attribute name="ScanForMappingsEnabled">true</attribute>
| <attribute name="StatGenerationEnabled">true</attribute>
| <attribute name="ShowSqlEnabled">false</attribute>
| <!--attribute name="Hbm2ddlAuto">update</attribute-->
| </mbean>
| </server>
|
Here is my class that I expect to be optimistically locked:
/*
| * $Id$
| */
| package hr.chipoteka.erp.data;
|
| import java.util.Date;
|
| /**
| * @hibernate.class lazy = "false" dynamic-update = "true"
| */
| public abstract class Analitika extends DataObject {
| ...
|
| /**
| * @hibernate.version type = "timestamp"
| */
| public Date getTs() {
| return ts;
| }
|
| public void setTs(Date ts) {
| this.ts = ts;
| }
| }
and one subclass:
package hr.chipoteka.erp.data.artikl;
|
| import hr.chipoteka.erp.data.Analitika;
| import hr.chipoteka.erp.data.SlimDataObject;
| import hr.chipoteka.erp.data.osoba.PoslovniPartner;
| import hr.chipoteka.erp.data.osoba.adresa.Drzava;
|
| import java.util.*;
|
| /**
| * @hibernate.union-subclass lazy = "false" dynamic-update = "true"
| */
| public class Artikl extends Analitika implements SlimDataObject {
| ...
| }
Generated hbm.xml looks like this:
?xml version="1.0" encoding="UTF-8"?>
|
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping
|
| >
|
| <class
| name="hr.chipoteka.erp.data.Analitika"
| lazy="false"
| dynamic-update="true"
| >
|
| ...
|
| <version
| name="ts"
| column="ts"
| type="timestamp"
| />
|
| ...
|
| <union-subclass
| name="hr.chipoteka.erp.data.artikl.Artikl"
| dynamic-update="true"
| lazy="false"
| >
|
| ...
|
| </union-subclass>
| ...
| </class>
|
| </hibernate-mapping>
|
I use hibernate within stateless session beans.
When running some HQL queries, I stop jboss at a breakpoint and check locks in the database (postgres):
select pg_class.relname,pg_locks.locktype, page, tuple, transaction, pid, mode, granted from pg_class,pg_locks where pg_class.relfilenode=pg_locks.relation and pid = 31761 order by relname;
| relname | locktype | page | tuple | transaction | pid | mode | granted
| ---------------+----------+------+-------+-------------+-------+-----------------+---------
| artikl | relation | | | 5378326 | 31761 | AccessShareLock | t
| (1 rows)
|
What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981510#3981510
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981510
19 years, 6 months
[JBossCache] - Hibernate optimistic locking & JBossCache
by kresho
Hibernate 3.1, Jboss 4.0.3SP1
I'm trying to get optimistic locking to work, but with no luck.
I'm using Jboss cache 1.4. Configuration of cache and session factory:
<server>
| <mbean code="org.jboss.cache.TreeCache" name="jboss.har:service=HarSecondLevelCache">
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
| <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_">
| <attribute name="maxNodes">50000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| <!-- Maximum time an object is kept in cache regardless of idle time -->
| <attribute name="maxAgeSeconds">600</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Chip_HB_LOCAL">
| <attribute name="DatasourceName">java:/jdbc/ChipDS_LOCAL</attribute>
| <attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
| <attribute name="SessionFactoryName">java:/hibernate/ChipHB_LOCAL</attribute>
| <attribute name="CacheProviderClass">org.jboss.hibernate.cache.DeployedTreeCacheProvider</attribute>
| <attribute name="DeployedTreeCacheObjectName">jboss.har:service=HarSecondLevelCache</attribute>
| <attribute name="ReflectionOptimizationEnabled">false</attribute>
| <attribute name="MaxFetchDepth">1</attribute>
| <attribute name="ScanForMappingsEnabled">true</attribute>
| <attribute name="StatGenerationEnabled">true</attribute>
| <attribute name="ShowSqlEnabled">false</attribute>
| <!--attribute name="Hbm2ddlAuto">update</attribute-->
| </mbean>
| </server>
|
Here is my class that I expect to be optimistically locked:
/*
| * $Id$
| */
| package hr.chipoteka.erp.data;
|
| import java.util.Date;
|
| /**
| * @hibernate.class lazy = "false" dynamic-update = "true"
| */
| public abstract class Analitika extends DataObject {
| ...
|
| /**
| * @hibernate.version type = "timestamp"
| */
| public Date getTs() {
| return ts;
| }
|
| public void setTs(Date ts) {
| this.ts = ts;
| }
| }
and one subclass:
package hr.chipoteka.erp.data.artikl;
|
| import hr.chipoteka.erp.data.Analitika;
| import hr.chipoteka.erp.data.SlimDataObject;
| import hr.chipoteka.erp.data.osoba.PoslovniPartner;
| import hr.chipoteka.erp.data.osoba.adresa.Drzava;
|
| import java.util.*;
|
| /**
| * @hibernate.union-subclass lazy = "false" dynamic-update = "true"
| */
| public class Artikl extends Analitika implements SlimDataObject {
| ...
| }
Generated hbm.xml looks like this:
?xml version="1.0" encoding="UTF-8"?>
|
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping
|
| >
|
| <class
| name="hr.chipoteka.erp.data.Analitika"
| lazy="false"
| dynamic-update="true"
| >
|
| ...
|
| <version
| name="ts"
| column="ts"
| type="timestamp"
| />
|
| ...
|
| <union-subclass
| name="hr.chipoteka.erp.data.artikl.Artikl"
| dynamic-update="true"
| lazy="false"
| >
|
| ...
|
| </union-subclass>
| ...
| </class>
|
| </hibernate-mapping>
|
I use hibernate within stateless session beans.
When running some HQL queries, I stop jboss at a breakpoint and check locks in the database (postgres):
select pg_class.relname,pg_locks.locktype, page, tuple, transaction, pid, mode, granted from pg_class,pg_locks where pg_class.relfilenode=pg_locks.relation and pid = 31761 order by relname;
| relname | locktype | page | tuple | transaction | pid | mode | granted
| ---------------+----------+------+-------+-------------+-------+-----------------+---------
| artikl | relation | | | 5378326 | 31761 | AccessShareLock | t
| (1 rows)
|
What am I doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981509#3981509
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981509
19 years, 6 months