Mike,

If you look closer at the examples, you will see that the DataSource is kept for
the life of the bean, but the connection is only kept for the life of each
method's use of if.  I would try moving the opening and closing of the connection
into the method that needs it.  You appear to be opening and closing the
connection in several places.

Hope that helps some.

John

Mike Friesen wrote:

> I have written a very simple stateful session bean that inserts records into
> InstantDB.  If I have only 1 client inserting records, I experience to
> problems.  Once I start getting multiple client, I experience random problems.
>
> The following are the 3 most common errors:
> 1) TransactionImpl.timeoutExpired(Object arg)
> 2) Unexpected Exception on commit_one_phase
> 3) Container cannot commit a transaction
>
> All 3 seem to be related to a synchronize problem of writing data to the
> database, hense explains why it works perfectly with 1 client.
>
> I've attached the source code to the insert bean.
> The procedure I'm using is as follows:
> 1) Create Session bean (which opens database connection)
> 2) Invoke the Insert method (which puts data into the database)
> 3) Close database
>
> If someone could please look at it and tell me what I'm doing wrong, it would
> be greatly appreciated,
>
> Mike
>
>   ------------------------------------------------------------------------
>                       Name: InsertBean.java
>    InsertBean.java    Type: Uedit32 File (text/x-java)
>                   Encoding: base64

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to