Re: Default jbosscache usage in JBoss AS 4.2/EJB3
by Brian Stansberry
For SFSB's, the first part of the Fqn is obtained by
Container.getEjbName(). AIUI, only one container per vm can have a
particular ejb name, so beans from different deployments are segregated.
For entities, by default Hibernate uses the name of the entity's class
as the first part of the Fqn. So, multiple deployments that use the same
entity class would end up placing objects in the same region of the
cache. If hibernate.cache_region.prefix is set, that value is used as a
further qualifier to the Fqn.
Bill Burke wrote:
> Don't we do something like this for SFSBs already? I don't remember the
> code I wrote *blush*.
>
> Brian Stansberry wrote:
>> Forwarding to Carlo and Bill DeCoste. The
>> hibernate.cache_region.prefix would need to be derived from the
>> deployment scope, probably the same algorithm used to create JMX
>> ObjectNames for the deployment's beans. Want to keep the name fairly
>> short, as it gets transmitted with every replication/invalidation
>> message.
>>
>> Emmanuel Bernard wrote:
>>> Don't know who exactly, but definitely, Carlo should be aware of that.
>>>
>>> On 17 avr. 07, at 09:57, Max Rydahl Andersen wrote:
>>>
>>>> Hi guys,
>>>>
>>>> From various discussions I understand that JBoss AS 4.2 currently
>>>> deploys a single JBC instance for use as a shared cache across EJB3
>>>> deployments
>>>> and that individual EJB3 deployments will by default share the same
>>>> cache resulting in them sharing the same cache regions.
>>>>
>>>> That is bad!
>>>>
>>>> Two independent applications should not share the same cache regions
>>>> - they should *always* be seperated by setting
>>>> hibernate.cache_region.prefix so
>>>> they only get access to the data that is actually relevant for them.
>>>>
>>>> There will also be classloading issues with such a scheme.
>>>>
>>>> From my understanding the place to fix this is in the ejb3 deployer
>>>> to use whatever unique name these deployments have so the same
>>>> cache_region.prefix
>>>> will be set correctly across different nodes etc.
>>>>
>>>> If the above assumption about 4.2 is correct, who is the right
>>>> person to fix that ?
>>>>
>>>> ----
>>>> Max Rydahl Andersen
>>>> callto://max.rydahl.andersen
>>>>
>>>> Hibernate
>>>> max(a)hibernate.org
>>>> http://hibernate.org
>>>>
>>>> JBoss a division of Red Hat
>>>> max.andersen(a)jboss.com
>>>
>>
>>
>
--
Brian Stansberry
Lead, AS Clustering
JBoss, a division of Red Hat
brian.stansberry(a)redhat.com
18 years, 11 months
jbossmc build
by Scott M Stark
After checking out the current jbossmc
trunk(https://svn.jboss.org/repos/jbossas/projects/microcontainer/trunk/)
its failing to compile. What is the snapshot repo being referenced here?
its not compiling
mvn compile
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] JBoss Microcontainer Build
[INFO] JBoss Microcontainer Container
[INFO] JBoss Microcontainer Dependency
[INFO] JBoss Microcontainer Kernel
[INFO] JBoss Microcontainer AOP MC INT
[INFO] JBoss Microcontainer Metatype
[INFO] JBoss Microcontainer Managed
[INFO] JBoss Microcontainer Deployers
[INFO] JBoss Microcontainer Spring Int
[INFO] JBoss Microcontainer OSGI INT
[INFO] JBoss Microcontainer Aggregator
[INFO]
----------------------------------------------------------------------------
[INFO] Building JBoss Microcontainer Build
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO]
----------------------------------------------------------------------------
[INFO] Building JBoss Microcontainer Container
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO]
----------------------------------------------------------------------------
[INFO] Building JBoss Microcontainer Dependency
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO]
----------------------------------------------------------------------------
[INFO] Building JBoss Microcontainer Kernel
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO]
----------------------------------------------------------------------------
[INFO] Building JBoss Microcontainer AOP MC INT
[INFO] task-segment: [compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading:
http://snapshots.jboss.org/maven2//jboss/jboss-aop/2.0.0-SNAPSHOT/jboss-a...
[WARNING] Unable to get resource from repository jboss-snapshots
(http://snapshots.jboss.org/maven2/)
Downloading:
http://snapshots.jboss.org/maven2//jboss/jboss-aop/2.0.0-SNAPSHOT/jboss-a...
[WARNING] Unable to get resource from repository jboss-snapshots
(http://snapshots.jboss.org/maven2/)
[INFO]
------------------------------------------------------------------------[ERROR]
BUILD ERROR
[INFO]
------------------------------------------------------------------------[INFO]
Failed to resolve artifact.
Missing:
----------
1) jboss:jboss-aop:jar:2.0.0-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=jboss -DartifactId=jboss-aop \
-Dversion=2.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) jboss:jboss-aop-mc-int:jar:2.0.0-SNAPSHOT
2) jboss:jboss-aop:jar:2.0.0-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
jboss:jboss-aop-mc-int:jar:2.0.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
jboss-snapshots (http://snapshots.jboss.org/maven2/),
jboss (http://repository.jboss.org/maven2/)
[INFO]
------------------------------------------------------------------------[INFO]
For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------[INFO]
Total time: 4 seconds
[INFO] Finished at: Fri Apr 20 08:36:28 PDT 2007
[INFO] Final Memory: 18M/292M
[INFO]
------------------------------------------------------------------------
18 years, 11 months