[JBoss JIRA] Created: (JBMESSAGING-1826) Removing a reference and deleting a message in DB should be wrapped in a single transaction in JDBCPersistenceManager
by Yong Hao Gao (JIRA)
Removing a reference and deleting a message in DB should be wrapped in a single transaction in JDBCPersistenceManager
----------------------------------------------------------------------------------------------------------------------
Key: JBMESSAGING-1826
URL: https://jira.jboss.org/browse/JBMESSAGING-1826
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core Persistence
Affects Versions: 1.4.7.GA, 1.4.0.SP3.CP10
Reporter: Yong Hao Gao
Assignee: Yong Hao Gao
Fix For: 1.4.0.SP3.CP11, 1.4.8.GA
In JDBCPersistenceManager, when a message is delivered and completed, the message is removed from DB. It includes two deletes in the DB - the reference in JBM_MSG_REF and the message in JBM_MSG. The two deletes are currently done in two separate local transactions as in removeReference() method:
...
new RemoveReferenceRunner().executeWithRetry();
deleteMessage(ref.getMessage().getMessageID());
...
If a server crashes between the two operations, it will leave the tables in an inconsistent state, i.e. ref removed but the message still there. This may result in message stuck, as in this case:
1. A server is crashing when a client_ack comes in, the clienk_ack will cause the message to be cleared from the server. If the client_ack processing goes as far as that the removing of reference succeeds but failed to delete the message due to the crashing, the message is left in JBM_MSG table but the corresponding entry in JBM_MSG_REF is gone.
2. Eventually the jms client will get ack failure exception. It then expects the messages to be re-delivered after server start-up. But that will never happen. When the server starts up it loads references in JBM_MSG_REF for delivery, but this message's ref is gone.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Created: (HIBERNATE-54) problems w/ column names beginning with '_' (underscore) w/ apache derby database
by bugra uytun (JIRA)
problems w/ column names beginning with '_' (underscore) w/ apache derby database
---------------------------------------------------------------------------------
Key: HIBERNATE-54
URL: http://jira.jboss.com/jira/browse/HIBERNATE-54
Project: Hibernate
Issue Type: Bug
Environment: windows xp, java 1.5.0_09, eclispe 3.2.1, hibernate 3.2.1, derby 10.2.2.0, hibernate tools 3.2 beta8
Reporter: bugra uytun
Assigned To: Steve Ebersole
derby has problems with column names beginning with underscore, see also http://db.apache.org/derby/docs/10.1/ref/crefsqlj1003454.html
therefore such column names should be between double quotation marks (notice that double quotation marks also sets the case sensitivity on column names.)
but hibernate translates a HQL statement like this "from table1 t where t.id = '1'" to something like:
select table1_.id as id4, table1_._colname1 as column27_4_ schema1.table1 table1_ where table1_.id = '1'
but because of the columns that are beginning with an underscore the translation should be:
select table1_."id" as id4, table1_."_colname1" as column27_4_ schema1."table1" table1_ where table1_."id" = '1'
the errors i got are:
DEBUG [JDBCExceptionReporter]: could not execute query [<translated sql statement>]
ERROR 42X01: Syntax error: Encountered "_" at line 1, column 987.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at <mypackage>.MyHibernate.main(MyHibernate.java:13)
WARN main org.hibernate.util.JDBCExceptionReporter - SQL Error: 20000, SQLState: 42X01
ERROR main org.hibernate.util.JDBCExceptionReporter - Syntax error: Encountered "_" at line 1, column 987.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Created: (JBRULES-2785) Documentation fixes w.r.t. events
by Wolfgang Laun (JIRA)
Documentation fixes w.r.t. events
----------------------------------
Key: JBRULES-2785
URL: https://jira.jboss.org/browse/JBRULES-2785
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-docs
Affects Versions: 5.1.1.FINAL
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Priority: Critical
Fix For: 5.2.0.M1
Correct the documentation:
(1) Explicit expiry time by @expires() in declare has precedence over implicit, dervide from rules. (Critical, because right now is documented the other way round.)
(2) Document that declare without any fields must refer to an existing, imported type.
(3) Document the semantics of timer, and that timer() can only be used in a STREAM session. Also, document that "int:" (as in "timer(int: 0 1m)") is optional.
(4) Make it clear that window:length( N ) is also satisfied if there are less than N events.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Created: (JBRULES-2681) Drools: Unable to load session snapshot
by Gustavo Tenrreiro (JIRA)
Drools: Unable to load session snapshot
---------------------------------------
Key: JBRULES-2681
URL: https://jira.jboss.org/browse/JBRULES-2681
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.1.0.FINAL
Environment: Windows Server, SQL Server 2005, Tomcat 5.5, Hibernate, Bitronix
Reporter: Gustavo Tenrreiro
Assignee: Mark Proctor
After an event is processed the session fails to load using JPA persistence.
I ve attached a test case.
It uses a Drools flow file, and a drl file. Both very simple..
The flow file has a "Start" then an action that prints a message to the console, then "End"
The Drl has one rule that processes an event:
import com.kgcontrols.services.company.standardsRequests.workflow.events.VoteCreatedEvent
declare VoteCreatedEvent
@role(event)
end
rule "testEvents"
when
VoteCreatedEvent() from entry-point "VoteCreatedStream"
then
System.out.println("--------------------------- YEAH the event got here");
end
I can see the "YEAH the event go here" on the console so I know the rule fired. But after that, if I try to load the session from the database I get:
1.
INFO 2010-09-02 08:28:56 [ERROR] com.kgcontrols.services.company.standardsRequ
2.
ests.workflow.TimerRunner java.lang.reflect.InvocationTargetException
3.
java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
4.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
5.
Service(KnowledgeStoreServiceImpl.java:106)
6.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.loadStatefu
7.
lKnowledgeSession(KnowledgeStoreServiceImpl.java:74)
8.
at org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeS
9.
ession(JPAKnowledgeService.java:118)
10.
at com.kgcontrols.services.company.standardsRequests.workflow.JPAKnowle
11.
dgeSessionLookup.loadSession(JPAKnowledgeSessionLookup.java:103)
12.
at com.kgcontrols.services.company.standardsRequests.workflow.TimerRunn
13.
er.run(TimerRunner.java:39)
14.
at java.lang.Thread.run(Thread.java:619)
15.
Caused by: java.lang.reflect.InvocationTargetException
16.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
17.
18.
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
19.
orAccessorImpl.java:39)
20.
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
21.
onstructorAccessorImpl.java:27)
22.
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
23.
at org.drools.persistence.jpa.impl.KnowledgeStoreServiceImpl.buildComman
24.
Service(KnowledgeStoreServiceImpl.java:91)
25.
... 5 more
26.
Caused by: java.lang.RuntimeException: Unable to load session snapshot
27.
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
28.
ot(JPASessionMarshallingHelper.java:96)
29.
at org.drools.persistence.session.SingleSessionCommandService.initKsessi
30.
on(SingleSessionCommandService.java:196)
31.
at org.drools.persistence.session.SingleSessionCommandService.<init>(Sin
32.
gleSessionCommandService.java:159)
33.
... 10 more
34.
Caused by: java.lang.NullPointerException
35.
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:135)
36.
at org.drools.reteoo.LeftTuple.<init>(LeftTuple.java:121)
37.
at org.drools.marshalling.impl.InputMarshaller.readLeftTuple(InputMarsha
38.
ller.java:461)
39.
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMars
40.
haller.java:351)
41.
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshall
42.
er.java:205)
43.
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarsh
44.
aller.java:91)
45.
at org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapsh
46.
ot(JPASessionMarshallingHelper.java:91)
47.
... 12 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months