[JBoss Cache] - hibernate-jbosscache2 and mvcc issues
by nithya anand
nithya anand [http://community.jboss.org/people/anandkrish] created the discussion
"hibernate-jbosscache2 and mvcc issues"
To view the discussion, visit: http://community.jboss.org/message/543483#543483
--------------------------------------------------------------
HI,
We opted to implement JbossCache-core-3.x on Local (means not on cluster) since it comes with mvcc. We were on jboss 4.2.3 (with hibernate 3.2) and realized that jbosscache-core- 3 needs hibernate 3.3. So we upgraded to Jboss 5 which comes with jbossCache-core - 3.0.1, Hibernate 3.3.1 and hibernate-jbosscache2 (3.3.1).
Issues:
1. Maven dependency conflict: hibernate-jbosscache2 (3.3.1) has a dependency on jbosscache-core-2.1.1.GA. We found that hibernate-jbosscache2 (3.3.2) has a dependency on jbosscache-core-3.x.GA, but we didn't want to mess up with the default jars that comes with JBOSS 5.
2. MVCC: (Caching turned on) Since with all these jar issues I want to make sure that the cache is working with mvcc turned on. But couldn't find any info on log that says that mvcc is turned on.
the following is our persistence.xml
<persistence-unit name="abcdb">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>MySqlDS</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="hibernate.use_sql_comments" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.connection.useUnicode" value="true"/>
<property name="hibernate.connection.characterEncoding" value="UTF-8"/>
<!-- Caching configuration -->
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory"/>
<property name="hibernate.cache.region.jbc2.cfg.shared" value="blahblah.xml"/>
<property name="hibernate.current_session_context_class" value="jta"/>
<property name="jboss.entity.manager.jndi.name" value="java:/abcdb"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/abcdbfactory"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
3. I wanted to provide a config file (even though not mandatory) for my JbossCache configuration to make sure mvcc is turned on.
But, even if i don't have blahblah.xml on my classpath, it wouldn't complaint. I don't see any error saying that blahblah.xml is missing.
Questions:
1. how can I make sure that my jbosscache is running on mvcc mode.
2. whats with the "hibernate.cache.region.jbc2.cfg.shared" value="blahblah.xml" file? do we need it at all?
Please answer my questions.
Thanks,
Anand.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543483#543483]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
[JCA] - javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
by Shinan Kassam
Shinan Kassam [http://community.jboss.org/people/skassam] created the discussion
"javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"
To view the discussion, visit: http://community.jboss.org/message/543473#543473
--------------------------------------------------------------
I have a jndi resource setup and working correctly. I was using JDBCRealm but now that I have my datasource setup I'd like to use DatasourceRealm.
I get "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context" error when trying to login
context.xml:
<Context>
<Realm debug="99"
className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/MyDb"
userTable="usrsec"
userNameCol="usrsec_userid"
userCredCol="usrsec_pswd"
userRoleTable="usrsec" roleNameCol="usrsec_level"
/>
<Valve className="flex.messaging.security.TomcatValve"/>
</Context>
jboss-web.xml:
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/MyDb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:jdbc/MyDb</jndi-name>
<res-auth>Container</res-auth>
</resource-ref>
</jboss-web>
Part of my web.xml:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/MyDb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
database-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/MyDb</jndi-name>
<!-- Sybase jConnect URL for the database.
NOTE: The hostname and port are made up values. The optional
database name is provided, as well as some additinal Driver
parameters.
-->
<connection-url>jdbc:ianywhere:DRIVER=SQL Anywhere 10;UID=xxx;PWD=xxx;ENG=HostServer;LINKS=tcpip(HOST=10.6.1.99;DoBroadcast=None)</connection-url>
<driver-class>ianywhere.ml.jdbcodbc.jdbc3.IDriver</driver-class>
<user-name>xxx</user-name>
<password>xxx</password>
<!--pooling parameters-->
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<!--<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>-->
<!-- sql to call when connection is created -->
<!-- sql to call on an existing pooled connection when it is obtained from pool -->
<check-valid-connection-sql>SELECT dbInfo_id FROM dbInfo</check-valid-connection-sql>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Sybase</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543473#543473]
Start a new discussion in JCA at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months
Re: [jboss-user] [jBPM] - start a process within another process in jbpm 4.3
by Al Nadein
Al Nadein [http://community.jboss.org/people/matrixpooh] replied to the discussion
"start a process within another process in jbpm 4.3"
To view the discussion, visit: http://community.jboss.org/message/543442#543442
--------------------------------------------------------------
In short, I start a process that happily follows a few steps before it hits a 'wait' state where it's persisted to db. At some point, i have to derive by the rules if any other sub-processes have to be created. Since jbpm provides an option to create only 1 subprocess at a given step, I'm openning subprocesses programmatically, i.e. in *CreateSubprocesses* activity handler:
{code}
//calculate groups to assign to a swimlane
taskAssignees = ...;
assigneeGroups.put(SharedConstants.KEY_SWIMLANE_CANDIDATE_GROUPS, taskAssignees);
ProcessInstance processInstance = executionService.startProcessInstanceByKey("subprocess_1", assigneeGroups);
{/code}
Again, all of the above is done in an activity handler of the process that has just been instantiated and hasn't been saved to db yet.
Here's a shortened version of my jpdl:
{code:xml}
<process key="main" name="main" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="5,23,48,48" name="start">
<transition g="141,46:-88,-15" name="open.case" to="Create sub-process"/>
</start>
<state g="306,193,148,52" name="Wait For Update">
<transition g="-23,-24" name="end" to="end1"/>
</state>
<custom g="239,26,138,52" name="Create sub-process" class="*CreateSubprocesses*">
<transition g="484,52:-108,-17" name="to-split-paths" to="Wait For Update"/>
</custom>
<end g="566,493,48,48" name="end1"/>
</process>
{/code:xml}
and one of possible sub-processes (simplified):
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<process name="test" key="test" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<swimlane candidate-groups="#{assigned.responsibilities}" name="assigned-group"/>
<start name="start1" g="16,21,48,48">
<transition name="to task1" to="task1" g="-17,-20"/>
</start>
<end name="end1" g="219,17,48,48"/>
<task name="task1" g="96,16,92,52" swimlane="assigned-group">
<transition name="to end1" to="end1" g="-20,-19"/>
</task>
</process>
{/code:xml}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543442#543442]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 5 months