[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-user
Subject:    [JBoss-user] [EJB/JBoss] - Problems with EJB 1.1 Entity BMP commit-options and cached b
From:       stille <nukes () jboss ! org>
Date:       2004-04-30 16:29:26
Message-ID: 20775014.1083342566736.JavaMail.root () nukes ! jboss ! org
[Download RAW message or body]

Hello.
I have a big problem: IÂ m migrating an application from jboss 2.0 to 3.2.3 The \
application works just fine in 2.0, but in 3.2.3 we have problems with some EJBÂ s \
1.1. The thing is that one EJB 1.1 bean does an ejbCreate, and then returns to \
another EJB 1.1 bean the PK of the created object. At this point, the container \
should have to do a ejbLoad to retrieve the proper info of the object in order to \
synchronize ir, and give it to me, but it s not doing that. I tried changing all \
the <commit-option> from the file standardjboss.xml to D, C and even B, but none of \
this made the HOME interfase to do de ejbLoad. What s going on? Do I have to \
change some other configuration file???

Here s a portion of the code:

The EJB 1.1 TaxAssessmentADMBean (Session) do this in one of it s methods:
// Get JNDI reference
                    TaxAssessmentHome assessmentHome =
                        (TaxAssessmentHome)new ServiceLocator().getRemoteHome(
                        "TaxAssessment",
                        TaxAssessmentHome.class);

                    assessmentItem = assessmentHome.create(
                                                           taxableObjectId,
                                                           taxPayerId,
                                                           ujc,
                                                           type,
                                                           xmlAssessment,
                                                           userId,
                                                           period,
                                                           version);
//In assessmentItem i have an assessmentId = 0, as if the object didn t retrieve \
                the info from the DB
                    logger.debug("assessment created ID :" + \
assessmentItem.getAssessmentId());

                    return assessmentItem.getAssessmentId();

In the EJB 1.1 TaxAssessmentBean (Entity BMP) we have this ejbCreate method:
public TaxAssessmentPK ejbCreate(
                                         long taxableObjectId,
                                         long taxpayerId,
                                         long ujc,
                                         java.lang.String type,
                                         java.lang.String xmlData,
                                         long userId,
                                         long period,
                                         long version) throws CreateException
        {
            logger.debug("ejbCreate");
            /*PreparedStatement prepStmtGet = null;
               PreparedStatement preStmtInsertClob = null;
               PreparedStatement prepStmtUpdateClob = null;
               PreparedStatement prepUpdateXMLType = null;*/

            logger.debug("Create");
            Connection con = null;
            long ID = 0;
            try
            {
                this.taxableObjectId = taxableObjectId;
                this.taxpayerId = taxpayerId;
                this.ujc = ujc;
                this.assessmentType = type;
                this.xmlData = xmlData;
                //            this.assessmentDate           = assessmentDate;
                this.userId = userId;
                this.period = period;
                this.version = version;

                con = new ServiceLocator().getDBConn(ServiceLocator.TAXDB_JNDINAME);

                CallableStatement cs =
                    con.prepareCall(
                    "{? = call ast$abm.actioninsert(?,?,?,?,?,?,?,?,?)}");
                // stored func
                cs.registerOutParameter(1, Types.NUMERIC);
                cs.setLong(2, this.ujc);
                cs.setLong(3, this.taxableObjectId);
                cs.setLong(4, this.taxpayerId);
                cs.setString(5, this.assessmentType);
                cs.setString(6, this.xmlData);
                //            cs.setClob(6, clob);
                cs.setDate(7, this.assessmentDate);
                cs.setLong(8, this.userId);
                cs.setLong(9, this.period);
                cs.setLong(10, this.version);
                cs.executeUpdate();
                //clob.freeTemporary();
                ID = cs.getLong(1);

                logger.debug("ID CREADA ["+cs.getLong(1)+"]");

            }
            catch(Exception e)
            {
                throw new EJBException(
                    "TaxAssessment EJBException ejbCreate :" + e.toString());
            }
            finally
            {
                try
                {
                    if(con != null)
                    {
                        con.close();
                        logger.debug("libere conexion de ejbCreate " + \
con.toString());  }
                }
                catch(Exception e)
                {
                }
                /*              try { if (prepStmtGet != null) { prepStmtGet.close(); \
} }  catch(Exception e) {}
                 try { if (preStmtInsertClob != null) { preStmtInsertClob.close(); } \
}  catch(Exception e) {}
                 try { if (prepStmtUpdateClob != null) { prepStmtUpdateClob.close(); \
} }  catch(Exception e) {}
                 try { if (prepUpdateXMLType != null) { prepUpdateXMLType.close(); } \
}  catch(Exception e) {}                */
            }
            return new TaxAssessmentPK(ID);
        }

As you can see, the code is just fine, and it works excellent in jboss 2.0! The \
Entity Bean TaxAssessment returns a TaxAssessmentPK to the HOME object, and this one \
should call ejbLoad to synchronize data, and it doesn t. As I said, in jboss 2.0 \
it does it cause we see it in the logs, but in jboss 3.2.3 it doesn t

Thanks a lot,
Nicolà s


View the original post : \
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833262#3833262

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833262



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id149&alloc_id66&opk
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic