Hi,

In server.log, I can see that the Oracle error has been raised which I think
should be application error. Below is just a portion :


2002-10-16 12:48:03,775 ERROR
[org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.StreetsUserProfEntit
y] Could not create entity
java.sql.SQLException: ORA-01401: inserted value too large for column

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
        at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
        at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
        at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
        at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
        at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1602
)
        at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1527)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
:2045)
        at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
ment.java:395)
        at
org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeUpdate(L
ocalPreparedStatement.java:308)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(JDBCCrea
teEntityCommand.java:196)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEnt
ityCommand.java:131)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManage
r.java:527)
        at
org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManag
er.java:253)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntit
y(CachedConnectionInterceptor.java:270)
        at
org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:731)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.java:1119)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:73)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hronizationInterceptor.java:209)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
CachedConnectionInterceptor.java:215)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
a:73)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erceptor.java:88)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
.java:79)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
erceptor.java:44)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
.java:111)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:178)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
a:105)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
        at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
        at org.jboss.ejb.Container.invoke(Container.java:730)
        at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)

********** END *******

However, in my CMP bean:
public void ejbCreate(...) throws ... {
  try {
    setAge() ;
    .... // other setters
  }
  catch(Exception e) {System.out.println("Error: " + e.toString()); }
}

I even cannot catch the exception. However, in my session bean, it catches
SQL exception:
StreetsUserSessionBean - addUser() Exception :javax.ejb.CreateException:
Could not create entity:java.sql.SQLException: ORA-01401: inserted value too
large for column

This error seems thrown from the container (why not SYSTEM error instead in
this case ???). So, I try to throw EJBException in my session bean. However,
no luck (the 1st insert still committed).

Thanks,
Camus



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Robson
Miranda
Sent: Tuesday, October 15, 2002 9:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Transaction and connection problems in JBoss
3.0.3


About item 2, it could be that the exception raised by the method does not
set the transaction to rollback. In EJB 2.0 spec (Chapter 18), a transaction
will be marked for rollback if an system exception (e.g. EJBException) is
thrown. An application exception will not mark the transaction for rollback.

Robson.

----- Original Message -----
From: "Camus Chan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 6:32 AM
Subject: [JBoss-user] Transaction and connection problems in JBoss 3.0.3


> Hi,
>
> I have a couple of problems when running JBoss 3.0.3 (actually starting
from
> JBoss 3.0.0) for a long time. Please give some hints, directions:
>
> System Information:
> OS: Solaris 2.7
> JBoss: 3.0.3
> Tomcat: 4.1.12
> Database: Oracle8i
> JDK: 1.3 / 1.4
> >>> JBoss and Tomcat are started successfully and the connection pool is
set
> as well, jars can be deployed successfully.
>
> Problems:
> 1. Everytime I call an CMP bean, a new connection is generated, and seems
> not being moved back to the pool nor reused. From v$session, I can see
that
> the connection keeps increased but not shrinked. Eventually the max. no of
> connection allowed (set in init.ora) is reached and running out and jboss
> raises exception. I read some 2.4.X manual, there is some parameters
> control, like gcenabled, gcidletimeout, ...etc. which can control the
> behaviour of connections getting from the pool, but I cannot set them in
> oracle-service.xml as no such attributes are allowed to be set. Are they
> obsolete in JBoos3.X ? Or any other methods / procedures to do the same
> thing ?
>
> 2. I cannot write any workable transaction sample. The scenario is that:
> I have a (stateless) session bean which looks up two CMP beans, each of
the
> CMP beans insert a record (into two different tables). However, I notice
> that whatever the result of the 2nd insert (e.g. Oracle raises errors),
the
> 1st insert get committed automatically (this is accomplished by placing a
> sleep between the two inserts and select from the Oracle table in
SQLPlus).
> I have tried using user-transaction and container-managed transactions
mode,
> but no luck.
> I am using oracle-service.xml and the trans-type in the ejb-jar.xml is set
> to required. I cannot switch to use oracle-xa-service.xml as jboss errors
> raised (javax.ejb.FinderException: Find failed:
> java.lang.IllegalArgumentException: null xaRes) when calling the CMP beans
> ( I have appiled the changes to jboss-service.xml as stated in the
> oracle-xa-service.xml but not to transaction-service.xml as I cannot find
> that files any where in the downloaded package). I do think JBoss should
be
> tested with transaction before released, but what's the problem with my
> cases, configurations or beans or ... ?
>
> 3. Can you tell me what are the differences between oracle-service.xml and
> oracle-xa-service.xml ? Should I use oracle-xa-service.xml ? How to make
it
> works to use oracle-xa-service.xml ?
>
> 4. The shutdown.sh doesn't work in JBoss 3.0.3 (but it works in
JBoss3.0.0)
> and the jboss doesn't have any response to it.
>
> 5. When redeploying an existing jar, the classcastexception occurs if
using
> JDK1.4 but not with JDK1.3. However, after restarting JBoss, it works
again.
>
>
> Sorry, for my long paragraphs. I have asked these questions from the JBoss
> forums but not much responses and solutions. Attached please also find my
> configuration files FYR. Please help.
>
> Many Thanks,
> Camus
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>



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



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to