[Microcontainer] - Re: StructureDeployer that supports subdeployments
by alesj
"beve" wrote :
| Regarding the solution with a StructureProcessor and the example you gave , SeamTempModificationTypeMatcher. Could you explain a little more how this could be used to solve the issue with subdirectory deployments?
|
You would write your own EsbModificationTypeMatcher.
Where ModificationTypeStructureProcessor picks up this EMTM by MC's incallback.
e.g.
| public class EsbModificationTypeMatcher implements ModificationTypeMatcher
| {
| private StructureDeployer warStructureDeployer = null; // get it injected
| private VFSStructuralDeployers deployers = null; // get it injected
|
| public boolean determineModification(VirtualFile root, StructureMetaData structureMetaData)
| {
| try
| {
| if (root.getName().endsWith(".esb"))
| {
| VirtualFile wars = root.getChild("wars");
| if (wars != null)
| {
| List<VirtualFile> children = wars.getChildren();
| for (VirtualFile war : children)
| {
| StructureContext context = new StructureContext(root, root, war, structureMetaData, deployers, null);
| warStructureDeployer.determineStructure(context);
| }
| }
| return true;
| }
| }
| catch (Exception ignored)
| {
| }
| return false;
| }
|
| public boolean determineModification(VirtualFile root, ContextInfo contextInfo)
| {
| // cannot change sub-deployment
| return false;
| }
| }
|
Perhaps try something like this.
If this doesn't work, I would fallback to writing my own StructureDeployer.
Where you can extend JARStructure (to only understand .esb) + change its candidateStructureVisitorFactory.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247569#4247569
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247569
16 years, 8 months
[Persistence, JBoss/CMP, Hibernate, Database] - Help composing HQL query
by sanches
Hello all,
I am trying to compose a statement which will fetch the latest "active" row from the table.
If the table would contain:
=id=obj_id=timestamp=active
--------------------------------
=0===1==2009-01-01=true
=1===1==2009-01-03=true
=2===1==2009-01-05=false
Then I needed row with id==1.
Obviously, it's better to run this in single query.
I guess this is inevitable to employ GROUP BY clause, but I was not able to compose query which Hibernate would accept (I use HSQL as DB)
I must use MAX() aggregate function since I need the latest timestamp.
I must group by obj_id since there are many records for object with the same id.
Therefore, the following query would satisfy:
select o2 from Orders o2 inner join
| (select max(o1.timestamp), o1.obj_id from Orders o1
| WHERE o1.active=true GROUP BY o1.obj_id) as o3
| on o2.obj_id=o3.obj_id
But such query containing subquery isn't accepted.
All examples of subqueries on http://docs.jboss.org/hibernate/stable/core/reference/en/html/queryhql.ht...
- either generates one-column-tables and use IN
- or use subqueries which return single row and use equality test.
Subquery above may return more than one row, can not be single-column as I must use both MAX() and GROUP BY id.
I think join is only solution here, but can not find formula.
Thank you.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247563#4247563
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247563
16 years, 8 months
[JBoss Messaging] - Re: JBM 1.4 and container transactions
by FrankTheTank
Update:
Doing some tests.
I have two destinations:
Queue (configured as non-clustered):
Destination : "queue/TestQueue"
Factory : "java:/JmsXA"
Type : "javax.jms.Queue"
NeedsTransactions : true
Topic (configured as clustered):
Destination : "queue/TestTopic"
Factory : "/ClusteredConnectionFactory"
Type : "javax.jms.topic"
NeedsTransactions : false
(stored in a lookup map)
Datasource that persists the jms topics is a xa-datasource.
I have an MBean that provides a jmx-console interface and a stateless SessionBean that will send the message.
The SessionBean's send() method is annotated with @TransactionAttribute(TransactionAttributeType.REQUIRED)
I use the above destination info and get the required components, then send out the message. No problemo.
Problem is, the transactions do not seem to be 'working' if the send() method fails (due to an exception I can trigger within the call but after 'sending' the message).
Regardless where I send it, with or without exception, the message will still come out.
My actual system should work as following:
The Queue is used on a per-node basis to inform other components if one component changes something.
f.i. if I change the addess of a user in one component, I want a message to be sent over the queue to a dedicated listener on that node.
The process must be transactional because if something goes wrong, we do not want the message to be sent.
This dedicated listener recieves the message and then, among other things, will propagate a stripped version of this event to a 'public' topic.
The topic should be cluster wide, so that a listener on Node B knows that something changed.
On this public topic there are multiple listeners that hungrily await these messages.
The messages on the 'public' topic need not be handled via transaction.
What am I doing wrong?
thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247550#4247550
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247550
16 years, 8 months