Bugs item #812620, was opened at 2003-09-25 11:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=812620&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivan Parra (ioparra)
Assigned to: Nobody/Anonymous (nobody)
Summary: On RC5

Initial Comment:
Alex-



Great job on cleaning up CMP optimistic locking.  I've 

been following the changes from 3.2.1 to the latest 

HEAD release.



It seems that you've fixed a large part of the problems 

related to optimistic locking and when, on commit, the 

SQL is created to update rows that may have been null.  

It seems that the order of the where clause is not 

matching the order of the set<Type>.  Here's an 

example from Branch3_2(RC5 from 9/25).



My environment is Oracle9i, JDK1.4, Win2k Prof, 

running RC5(ie Branch_3_2). modified-strategy



DB Schema:

CREATE TABLE Team

(

       TEAM_ID                   NUMBER(15),

       TEAM_OWNER_PERSON_ID      NUMBER(15) NULL,

       TEAM_NAME                 VARCHAR2(100) NULL,

       TEAM_CREATION_DATE        DATE NULL,

       TEAM_CREATED_BY           NUMBER(15) NULL,

       TEAM_LAST_UPDATE_DATE     DATE NULL,

       TEAM_LAST_UPDATED_BY      NUMBER(15) NULL

);





I first do a create(long) to create the row, then set the 

individual values.  Only at commit are these values 

trully updated.  Here's the output with trace turned on:



[Team] Executing SQL: INSERT INTO TEAM(TEAM_ID, 

TEAM_NAME, TEAM_CREATION_DATE, 

TEAM_CREATED_BY, TEAM_LAST_UPDATE_DATE, 

TEAM_LAST_UPDATED_BY, TEAM_OWNER_PERSON_ID) 

VALUES (?, ?, ?, ?, ?, ?, ?)

[id] Set parameter: index=1, jdbcType=BIGINT, 

value=3

[name] Set parameter: index=2, jdbcType=VARCHAR, 

value=NULL

[creationDate] Set parameter: index=3, 

jdbcType=TIMESTAMP, value=NULL

[createdBy] Set parameter: index=4, 

jdbcType=BIGINT, value=NULL

[lastUpdateDate] Set parameter: index=5, 

jdbcType=TIMESTAMP, value=NULL

[lastUpdatedBy] Set parameter: index=6, 

jdbcType=BIGINT, value=NULL

[id] Set parameter: index=7, jdbcType=BIGINT, 

value=NULL



This part is fine.  During commit, I get this trace.



11:13:32,745 DEBUG [PoolThread-8][Team] Executing 

SQL: UPDATE TEAM SET TEAM_NAME=?, 

TEAM_CREATION_DATE=?, TEAM_CREATED_BY=?, 

TEAM_LAST_UPDATE_DATE=?, 

TEAM_LAST_UPDATED_BY=?, 

TEAM_OWNER_PERSON_ID=? WHERE TEAM_ID=? AND 

TEAM_NAME=? AND TEAM_CREATION_DATE=? AND 

TEAM_CREATED_BY=? AND 

TEAM_LAST_UPDATE_DATE=? AND 

TEAM_LAST_UPDATED_BY=? AND 

TEAM_OWNER_PERSON_ID=?

[name] Set parameter: index=1, jdbcType=VARCHAR, 

value=foobar

[creationDate] Set parameter: index=2, 

jdbcType=TIMESTAMP, value=Thu Sep 25 11:13:32 

PDT 2003

[createdBy] Set parameter: index=3, 

jdbcType=BIGINT, value=100

[lastUpdateDate] Set parameter: index=4, 

jdbcType=TIMESTAMP, value=Thu Sep 25 11:13:32 

PDT 2003

[lastUpdatedBy] Set parameter: index=5, 

jdbcType=BIGINT, value=100

[id] Set parameter: index=6, jdbcType=BIGINT, 

value=201

[id] Set parameter: index=7, jdbcType=BIGINT, 

value=3

[lastUpdateDate] Set parameter: index=8, 

jdbcType=TIMESTAMP, value=NULL

[id] Set parameter: index=9, jdbcType=BIGINT, 

value=NULL

[lastUpdatedBy] Set parameter: index=10, 

jdbcType=BIGINT, value=NULL

[createdBy] Set parameter: index=11, 

jdbcType=BIGINT, value=NULL

[name] Set parameter: index=12, jdbcType=VARCHAR, 

value=NULL

[creationDate] Set parameter: index=13, 

jdbcType=TIMESTAMP, value=NULL

[LogInterceptor] TransactionRolledbackException in 

method: ...

org.jboss.tm.JBossRollbackException: Unable to 

commit, tx=TransactionImpl:XidImpl [FormatId=257, 

GlobalId=MyMachine//51, BranchQual=] 

status=STATUS_NO_TRANSACTION; - nested 

throwable: (javax.ejb.EJBException: Store failed; 

CausedByException is:

        ORA-00932: inconsistent datatypes: expected 

NUMBER got TIMESTAMP

)

        at org.jboss.tm.TransactionImpl.commit

(TransactionImpl.java:408)

...



Caused by: javax.ejb.EJBException: Store failed; 

CausedByException is:

        ORA-00932: inconsistent datatypes: expected 

NUMBER got TIMESTAMP

        at 

org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityComman

d.execute(JDBCStoreEntityCommand.java:177)

        at 

org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.store

Entity(JDBCStoreManager.java:649)

        at 

org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity

(CMPPersistenceManager.java:421)

     

You can see that the insert types are in sync during the 

create stage but are out-of sync during the optimistic 

WHERE clause.  



If I have time, I'll look through the code and see if I 

can patch it.  I know that RC5 has not been released 

and, because of that, this bug may not be a priority.  

Figured there would be no harm on posting a bug 

now. :)



-Ivan



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=812620&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to