Re: [JBoss-user] Possible Bug with Minerva XADataSourceImpl and Opta's XDataSource

2001-08-07 Thread Kevin Meldorf (NBK)

Well, I did have the wrong method name in the descriptor --
thanks for catching that , I'm an idiot. However,
after putting the correct name in the descriptor, it still
is not working. Me very confused. Here is some more info.

As far as the confusion about what we are doing, lemme explain:
PkTable is our primary key generator. It is a two column table that contains
all the tablenames in our app that require primary keys and a nextId field.
I.e. 

table_name  nextId
--  --
traveler100
vendor_code 100

...etc. It only has one method returnPk(). In order to execute it
we just do a findByPrimaryKey("table_name") and then execute returnPk()
on the remote interface.

Our database is somewhat normalized so when adding a traveler we have
to hit 3 tables. traveler, traveler_address, and traveler_phone. I wrap
all of our entity beans with session beans that control a module. Therefore,
TravelerInterface is a session bean that interfaces with
the following entities:PkTable, Traveler, TravelerAddress, TravelerPhone.
addTraveler() in the Traveler interface session bean will call the create
method on the 3 entity beans that are related for traveler. We have controls
on our jsp interface to validate data, and I can even live
with everything rolling back if something is hosed up. My only concern 
in starting this whole thread is that RequiresNew is not functioning
how it is supposed to -- at least for me :-)

Okay, enough babbling the code is below. I await your response.

Thanks for your patience.

Kevin


Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

ejb-jar.xml


   Models the pk_table table
   PkTable
   com.wtp.sqme.ejb.entity.interfaces.PkTableHome
   com.wtp.sqme.ejb.entity.interfaces.PkTable
 
com.wtp.sqme.ejb.entity.implementations.PkTableBean
   Container
   java.lang.String
   False
   
  tableName
  table_name
   
   
  nextId
  next_id
   
   tableName




   
  
 PkTable
 returnPk
  
  RequiresNew
   


jaws.xml 


  

  
 PkTable
 pk_table
  
 tableName
 table_name
  
  
 nextId
 next_id
  

  

  

jboss.xml
  
 PkTable
 pktable
  

PkTableHome.java

package com.wtp.sqme.ejb.entity.interfaces;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.rmi.RemoteException;


/** PkTableHome.java: The home interface for PkTable,
 * a container managed entity bean which models the pk_table table.
 * @author: pfitzgib
 * @version: 1.0
 * Date Last Modified: Fri Jun 22 14:26:24 CDT 2001
 */

public interface PkTableHome extends EJBHome {

// Standard finders
PkTable findByPrimaryKey(String tableName)
throws RemoteException, FinderException;

// Custom finders -- you may have to tweak
// return types and parameters
}

PkTable.java

package com.wtp.sqme.ejb.entity.interfaces;

import javax.ejb.EJBObject;
import java.rmi.RemoteException;

/** PkTable.java: The remote interface for PkTable,
a container managed entity bean which models the pk_table table.
@author: pfitzgib
@version: 1.0
Date Last Modified: Fri Jun 22 14:26:24 CDT 2001
*/

public interface PkTable extends EJBObject {

   // getters and setters
   public String getTableName () throws RemoteException;
   public void setTableName (String tableName) throws RemoteException;

   public int getNextId () throws RemoteException;
   public void setNextId (int nextId) throws RemoteException;
   
   /** Pk generator method. Transactional method that generates primary keys
*  for the database.
*/
   public int returnPk() throws RemoteException;

}

PkTableBean.java

package com.wtp.sqme.ejb.entity.implementations;

import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import java.rmi.RemoteException;


/** PkTableBean.java: The implementation of the remote interface for
PkTable,
a container managed entity bean which models the pk_table table.
@author: pfitzgib
@version: 1.0
Date Last Modified: Fri Jun 22 14:26:24 CDT 2001
*/

public class PkTableBean implements EntityBean {

   // Data Members

   private EntityContext ctx;
   public String tableName;
   public int nextId;
  
   /** Notice that there are no create methods. This bean must be locked
down by the dba.
*  We only update the primary key values.
*/

   public void ejbRemove( )
   throws RemoteException { }

   public void ejbActivate( )
   throws RemoteException { }

   public void ejbPassivate( )
   throws RemoteException { }

   public void ejbLoad() throws RemoteException { }

   public void ejbStore()throws RemoteException { }

   public void setEntityContext(EntityContext ctx)
   throws RemoteException { 
  this.ctx = ctx;
   }

   public void unsetEntityContext() throws RemoteException

Re: [JBoss-user] Possible Bug with Minerva XADataSourceImpl and O pta's XDataSource

2001-08-06 Thread Kevin Meldorf (NBK)

whoops...you are right the name of that method
is now returnPk(). Here is the code for that method.
It is an entity bean with one business method returnPk(). 

   
   /** returnPk() is an atomic transaction that will get the nextId
* update the pktable and then return the id to the caller. */
   public int returnPk() throws RemoteException {

   int pkInt=-1;
   
   pkInt = this.getNextId();
   ++pkInt;
   this.setNextId(pkInt);
   return pkInt;
   }

Thanks,

Kevin



>I don't see any mention of the getNextId() method that you said
>was RequiresNew. How is that method called?
>My suspicion is that the pkRemote.returnPk() method calls it.
>If so, show us that method.



Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Possible Bug with Minerva XADataSourceImpl and Opta's XDataSource

2001-08-06 Thread Kevin Meldorf (NBK)

Thanks Toby. I am using CMP, so I'm not too sure what I would
be doing strange in my code. Here is the method that exhibits
the problem -- This is in a session bean that then hooks
up to the appropriate entity beans to do the create.

Kevin

public TravelerType addTraveler(TravelerType t, int creatorId) throws
RemoteException, CustomerDepartmentMismatchException {


PkTableHome pkHome = null;
TravelerHome travelerHome = null;
CustomerDepartmentHome custDeptHome = null;
TravelerAddressHome travelerAddressHome = null;
TravelerPhoneHome etPhoneHome = null;

Traveler traveler = null;

try {
Context ctx = (Context) new
InitialContext().lookup("java:comp/env");
pkHome = (PkTableHome) ctx.lookup("ejb/pktable");
travelerHome = (TravelerHome) ctx.lookup("ejb/traveler");
custDeptHome = (CustomerDepartmentHome)
ctx.lookup("ejb/customerdepartment");
travelerAddressHome = (TravelerAddressHome)
ctx.lookup("ejb/traveleraddress");
etPhoneHome = (TravelerPhoneHome)
ctx.lookup("ejb/travelerphone");
}
catch (NamingException ne) {
throw new RemoteException("COULDN'T GET INITIAL CONTEXTS IN
addTraveler()! Naming Exception is: " + ne.getMessage());
}

// get userId from pktable...and put it into the TravelerType
try {
PkTable pkRemote = pkHome.findByPrimaryKey("traveler");
t.travelerId = pkRemote.returnPk();
}
catch (FinderException fe) {
throw new RemoteException("COULDN'T FIND PRIMARY KEY FOR
sqme_user in addUser()!" +
"FinderException is: " + fe.getMessage() );
}

// Verify that customerId and customerDepartmentId are associated.

try {
if (t.customerDepartmentId != null) {
// Get Department item from customer_department by primary
key
CustomerDepartment custDept = (CustomerDepartment)
custDeptHome.findByPrimaryKey(t.customerDepartmentId);
if (custDept == null) {
throw new CustomerDepartmentMismatchException("CUSTOMER
DOESN'T MATCH CUSTOMER DEPT in addTraveler(): customerId=" + t.customerId +
" customerDepartmentId=" + t.customerDepartmentId);
} else if (t.customerId != custDept.getCustomerId()) {
throw new CustomerDepartmentMismatchException("CUSTOMER
DOESN'T MATCH CUSTOMER DEPT in addTraveler(): customerId=" + t.customerId +
" customerDepartmentId=" + t.customerDepartmentId);
}

}

} catch (FinderException fe) {
throw new CustomerDepartmentMismatchException(fe.getMessage());
}

// Create the traveler entity bean
try {
traveler = travelerHome.create(t, creatorId);
} catch (CreateException ce) {
throw new RemoteException("COULDN'T CREATE traveler IN
AddTraveler()! Create Exception is " +
ce.getMessage());
}

// Add the traveler address entity
try {
// Force all String values to Null if they should be
t.address = SqmeUtil.makeNull(t.address); 
t.mailStop = SqmeUtil.makeNull(t.mailStop);
t.suite =  SqmeUtil.makeNull(t.suite);
t.cityName = SqmeUtil.makeNull(t.cityName);
t.postalCode = SqmeUtil.makeNull(t.postalCode);
// If all address values are null/default, then the address
record will not be created.
if ( (t.address == null) &&
(t.suite == null) &&
(t.mailStop == null) &&
(t.cityName == null) &&
(t.stateId == null) &&
(t.countryId == -1) &&
(t.postalCode == null) ) {
// no-op all address info is default
} else {
TravelerAddress travelerAddress =
travelerAddressHome.create(
traveler.getTravelerId().intValue(), //int travelerId,
AddressTypeConstants.BUSINESS_ADDRESS_ID, //int
addressTypeId hard coded to address_type record 1: Business
t.mailStop, //String mailStop,
null, //String attnAdvisory,
null, //String addressAdvisory,
t.address, //String address,
t.suite, //String suite,
t.cityName, //String cityName,
t.stateId, //Integer stateId,
t.countryId, //int countryId,
t.postalCode //String postalCode
);

}

} catch (CreateException ce) {
throw new RemoteException("COULDN'T CREATE traveler IN
AddTraveler()! Create Exception is " +
ce.getMessage());
}

TravelerPhone travelerPhone = null;
// Add the traveler phone e

RE: [JBoss-user] Possible Bug with Minerva XADataSourceImpl and Opta's XDataSource

2001-08-03 Thread Kevin Meldorf (NBK)


According to the spec here is the def of a RequiresNew Transaction
attribute:

"...The container always executes a method that is assigned the RequiresNew
Transaction in a new transaction context. This means that the container
starts a new transaction before it executes the method, and it commits the
transaction after the method completes. If the method caller is already
associated with a transaction context at the time it calls the method, the
container suspends the association for the duration of the new transaction."


-- Mathena and Stearns "Applying Enterprise Javabeans"


>That's what would normally happen in a database that supports nested
>transactions.  Is JBoss different?

>Jim


Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Possible Bug with Minerva XADataSourceImpl and Opta's XDataSource

2001-08-03 Thread Kevin Meldorf (NBK)

There seems to be a problem when declaring a method with the 
RequiresNew transaction attribute. I have tested this with both
Minerva's org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl
and Opta's com.inet.tds.XDataSource -- in fact, Opta's was *really* not
working, but they have recently implemented a fix which now duplicates what
I see to be a problem with the Minerva XADataSource.

Here's the deal for those of you still with me:

I have a PkEntity Bean that performs one function getNextId(). I have
declared this method with the RequiresNew Transaction attribute in
ejb-jar.xml. 


   
  
 PkTable
 getNextId
  
  RequiresNew
   



Now I have a method in a session bean that performs 3 calls:
1. getNextId()
2. creates an entity in a user table (where the id is used)
3. create an entity in a user address table.

If I throw a RemoteException in #3, all 3 transactions roll back. 

Correct me if I am wrong, but #1 getNextId, since it is declared as
RequiresNew, should have completed/committed and not rolled back.

Has anyone else experienced this problem? Am I doing something wrong?

I am using jboss version 2.2.2 on Windows 2000 with MSSQLServer2000
using the Opta2000jdbc driver and I have the very latest version of the
driver.

If this is a bug, I will be happy to post it on Source Forge.

Thanks,

Kevin

Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Primitive Types in Entity beans

2001-07-18 Thread Kevin Meldorf (NBK)

In entity beans the primary key must be an object
all other fields may be of primitive type. If you
are having issues with non-primary key fields that
are primitives, check you standardjaws.xml or your
jaws.xml to make sure that they are mapping correctly
to your database.

Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 


>Hi:
>
>I'm implementing an entity bean that manage persintence (BMP). I declare
>the entity variables with primitive types like float and boolean.
>
>The problem is that the values of these variables seem to be lost, but
>if I use a object from Float class (an not from float type) it's work
>well.

>Is that normal? I always must use java classes and not primitive types?

>Thank You


___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Transaction issue with Requires new -- User error, Jboss, inet opta Jdbc Driver, or all of the above?

2001-07-17 Thread Kevin Meldorf (NBK)

I am using a primary key generator as an entity bean that has the
following transaction defined in my ejb-jar.xml:


   
  
 PkTable
 getNextId
  
  RequiresNew
   


I have a method in a stateless session bean where I am adding records to a
couple of different entities. If an exception is thrown, the entry to my
pktable is not being committed even though I have explicitly demarcated the
method as RequiresNew.

2 interesting issues: 

Using inet opta's DataSource (com.inet.tds.XDataSource) it fails in that the
pkTable row is not updated, but the entity is created -- really bad because
on the next insert there will be a duplicate key exception.

Using the minerva
DataSource(org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl) the
transaction rolls back on the pktable and the entity that I am trying to
create -- better but this is still not how it should be working.

Any ideas?

I am using Windows2000, Microsoft Sql Server 2000, inet opta driver 2000,
and jboss version 2.2.2.

Thanks in advance,

Kevin Meldorf 
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Finder Exception not being thrown with a findBy that returns a Collection

2001-07-16 Thread Kevin Meldorf (NBK)

When I do a findBy that will return a collection in CMP, no FinderException
is thrown, if no entities are found. Is this part of the EJB spec or is this
a bug?

I am using jboss 2.2 with MS SQL Server 2000 on Windows
2000 using the Opta 2000 inet driver


Thanks,

Kevin Meldorf
Systems Analyst 
WorldTravel BTI 
400 Skokie Blvd 
Northbrook, IL 60062 
Phone: (847) 480-8340 
[EMAIL PROTECTED] 

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Possible bug in jboss -- TxCapsule

2001-06-25 Thread Kevin Meldorf (NBK)

I have been working with inet software on chasing down
an issue with their XDataSourceDriver and jboss. Has
anyone else had any problems when not using the minerva
XADataSource driver?

Thanks,

Kevin Meldorf

-Original Message-
From: Volker Berlin (i-net software) [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 9:37 AM
To: Kevin Meldorf (NBK); '[EMAIL PROTECTED]'
Cc: Frank Thiemonge (NBK)
Subject: AW: Possible bug in jboss?


Hello,

The problem is that the class org.jboss.tm.TxCapsule has a status of
Status.STATUS_ACTIVE after creating with new.

The minerva driver in the class
org.opentools.minerva.jdbc.xa.XAConnectionFactory check only the value
Status.STATUS_NO_TRANSACTION. I all other case the transaction was end.

The bug can be in 
1.) the minerva because there are also other states without a transaction
(for example Status.STATUS_COMMITTED)

2.) That the minerva driver is involved. It can be that the dirver not work
together with other XADataSources.

3.) That the class org.jboss.tm.TransactionImpl the value of txCapsule is
set.


I have not found a workaround without to use the minerva driver. Please
inform me if there a new info.

If I understand the JDBC spec correctly then it is correct that the driver
throw an exception if the transaction  (XID) no exists.

Volker Berlin
i-net software



> -Ursprüngliche Nachricht-
> Von:  Kevin Meldorf (NBK) [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Donnerstag, 21. Juni 2001 16:26
> An:   '[EMAIL PROTECTED]'
> Cc:   '[EMAIL PROTECTED]'; Frank Thiemonge (NBK)
> Betreff:  Possible bug in jboss?
> 
> I have been working with Volker Berlin at inetsoftware to get the opta2000
> XDataSource to work with jboss 2.2. Whenever, I tried to 
> use the inet's XDataSource vs. minerva's XADataSource I would get the
> following error:
> 
> [UserEntityBean] XAException: tx=XidImpl [FormatId=257,
> GlobalId=KMELDORM//1, BranchQual=] errorCode=XAER_NOTA
> [UserEntityBean] javax.transaction.xa.XAException: The XID is not valid.
> [UserEntityBean]at com.inet.tds.k.if(Unknown Source)
> [UserEntityBean]at com.inet.tds.k.for(Unknown Source)
> [UserEntityBean]at com.inet.tds.k.end(Unknown Source)
> [UserEntityBean]at
> org.jboss.tm.TxCapsule.endResource(TxCapsule.java:1147)
> [UserEntityBean]at
> org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:541)
> [UserEntityBean]at
> org.jboss.tm.TransactionImpl.delistResource(TransactionImpl.java:99)
> [UserEntityBean]at
> org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.c
> loseConnection(XAConnectionFactory.java:97)
> [UserEntityBean]at
> org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.connectionClosed(XACon
> ne
> ctionFactory.java:82)
> [UserEntityBean]at com.inet.pool.c.a(Unknown Source)
> [UserEntityBean]at com.inet.tds.k.a(Unknown Source)
> [UserEntityBean]at com.inet.pool.a.close(Unknown Source)
> [UserEntityBean]at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:1
> 80
> )
> [UserEntityBean]at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.execute(JDBCFinderComman
> d.
> java:60)
> [UserEntityBean]at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEn
> ti
> tiesCommand.java:145)
> [UserEntityBean]at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntityCommand
> .execute(JDBCFindEntityCommand.java:64)
> [UserEntityBean]at
> org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntity(JAWSPersisten
> ce
> Manager.java:130)
> [UserEntityBean]at
> org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManag
> er
> .java:270)
> [UserEntityBean]at
> org.jboss.ejb.EntityContainer.find(EntityContainer.java:419)
> [UserEntityBean]at java.lang.reflect.Method.invoke(Native Method)
> [UserEntityBean]at
> org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContai
> ne
> r.java:639)
> [UserEntityBean]at
> org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySy
> nc
> hronizationInterceptor.java:160)
> [UserEntityBean]at
> org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceI
> nt
> erceptor.java:87)
> [UserEntityBean]at
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:13
> 5)
> [UserEntityBean]at
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCM
> T.
> java:263)
> [UserEntityBean]at
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86
> )
> [UserEntityBean]at
> org.jboss.ejb.plugins.Se

[JBoss-user] Possible bug in jboss

2001-06-21 Thread Kevin Meldorf (NBK)

I have been working with Volker Berlin at inetsoftware to get the opta2000
XDataSource to work with jboss 2.2. Whenever, I tried to 
use the inet's XDataSource vs. minerva's XADataSource I would get the
following error:

[UserEntityBean] XAException: tx=XidImpl [FormatId=257,
GlobalId=KMELDORM//1, BranchQual=] errorCode=XAER_NOTA
[UserEntityBean] javax.transaction.xa.XAException: The XID is not valid.
[UserEntityBean]at com.inet.tds.k.if(Unknown Source)
[UserEntityBean]at com.inet.tds.k.for(Unknown Source)
[UserEntityBean]at com.inet.tds.k.end(Unknown Source)
[UserEntityBean]at
org.jboss.tm.TxCapsule.endResource(TxCapsule.java:1147)
[UserEntityBean]at
org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:541)
[UserEntityBean]at
org.jboss.tm.TransactionImpl.delistResource(TransactionImpl.java:99)
[UserEntityBean]at
org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.c
loseConnection(XAConnectionFactory.java:97)
[UserEntityBean]at
org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.connectionClosed(XAConne
ctionFactory.java:82)
[UserEntityBean]at com.inet.pool.c.a(Unknown Source)
[UserEntityBean]at com.inet.tds.k.a(Unknown Source)
[UserEntityBean]at com.inet.pool.a.close(Unknown Source)
[UserEntityBean]at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:180
)
[UserEntityBean]at
org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.execute(JDBCFinderCommand.
java:60)
[UserEntityBean]at
org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEnti
tiesCommand.java:145)
[UserEntityBean]at
org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntityCommand
.execute(JDBCFindEntityCommand.java:64)
[UserEntityBean]at
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntity(JAWSPersistence
Manager.java:130)
[UserEntityBean]at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager
.java:270)
[UserEntityBean]at
org.jboss.ejb.EntityContainer.find(EntityContainer.java:419)
[UserEntityBean]at java.lang.reflect.Method.invoke(Native Method)
[UserEntityBean]at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
r.java:639)
[UserEntityBean]at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
hronizationInterceptor.java:160)
[UserEntityBean]at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
erceptor.java:87)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:263)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
[UserEntityBean]at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(
SecurityInterceptor.java:164)
[UserEntityBean]at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
[UserEntityBean]at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316)
[UserEntityBean]at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai
nerInvoker.java:436)
[UserEntityBean]at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:212)
[UserEntityBean]at $Proxy17.findByLogin(Unknown Source)
[UserEntityBean]at
com.wtp.nbk.security.UserSessionBean.findByLogin(UserSessionBean.java:297)
[UserEntityBean]at
com.wtp.nbk.security.UserSessionBean.returnPassword(UserSessionBean.java:254
)
[UserEntityBean]at
com.wtp.nbk.security.UserSessionBean.validateUser(UserSessionBean.java:155)
[UserEntityBean]at java.lang.reflect.Method.invoke(Native Method)
[UserEntityBean]at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
sSessionContainer.java:472)
[UserEntityBean]at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
ssionInstanceInterceptor.java:87)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:263)
[UserEntityBean]at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[UserEntityBean]at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:19
0)
[UserEntityBean]at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[UserEntityBean]at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.jav
a:271)
[UserEntityBean]at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:482)
[UserEntityBean]at
org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(Stateless
SessionProxy.java:152)
[UserEntityBean]

[JBoss-user] RE: opta2000 jdbc driver

2001-05-04 Thread Kevin Meldorf (NBK)



I'm using the opta 
i-net jdbc driver with SQL server 2000 and
Win2000 and I have 
not seen these errors when using transaction
requirements. Shoot 
me an email and let's see if we can chase
this one 
down.
 
Kevin
Kevin Meldorf Systems Analyst WorldTravel BTI 
400 Skokie Blvd Northbrook, IL 60062 Phone: (847) 
480-8340 [EMAIL PROTECTED] 

 


[JBoss-user] RE: Custom finders with JBoss and SQL Server ??

2001-05-04 Thread Kevin Meldorf (NBK)



I am using custom 
finders with MS SQL Server 2000 using the the Inet Opta
jdbc driver. For a 
custom finder with cmp you just need to include the finder 
in
your home stub and 
then define it in your jaws file:
 
Here's an 
example:
 
home 
stub:
 
 // more 
finders   Enumeration findByPoItemNumber (String 
poItemNumber)   throws RemoteException, 
FinderException;
 
jaws 
snippet:
 
 
OrderItemBean 
ORDER_ITEM  
 
orderItemId 
order_item_id  
  
 
poId 
po_id  
  
 
poItemNumber 
po_item_number  
  
 
quantity 
quantity  
  
 
description 
description  
  
 
unitPrice 
unit_price  
  
 
findByPoItemNumber 
po_item_number = 
{0}   
  

 
 
 
Kevin Meldorf Systems Analyst WorldTravel BTI 
400 Skokie Blvd Northbrook, IL 60062 Phone: (847) 
480-8340 [EMAIL PROTECTED] 

 


[JBoss-user] FW: Passing structures to an ejb

2001-05-03 Thread Kevin Meldorf (NBK)



Please 
ignore my last post...I see that overriding a method with a
blank 
method really messes things up for object serialization... 
:-)
 
Kevin 

 
 
-Original Message-From: Kevin Meldorf (NBK) 
Sent: Wednesday, May 02, 2001 3:55 PMTo: 
'[EMAIL PROTECTED]'Subject: Passing structures to an 
ejb
I am working on an 
application where I am trying to pass a non ejb ojbect to an 
EJB.
 
I have a session 
bean that I am trying to pass the following "structure" to my session 

bean.
 
import 
java.util.*;import java.io.*;
 
/** This is 
basically a file of structs that we will use in the    Po app 
-- If you are a hard core Java OOP guy please go away :-) 
**/    public class PoType implements Serializable 
{
 
 public 
AddressType billToAddress; public AddressType 
vendorAddress; public AddressType shipToAddress;
 
 public int 
ID; public String poNumber;
 
 public String 
yourName; public String yourPhone; public String 
name; public String phone;
 
 public Date 
dateOfOrder; public String departmentNo; public String 
generalLedgerNumber; public Date dateRequested;
 
 public Vector 
items;  // contains ItemType objects OrderItem
 
    
public float poTotal; public String 
comments;  private void writeObject(java.io.ObjectOutputStream 
out) throws IOException {}    
private void readObject(java.io.ObjectInputStream 
in) throws IOException, ClassNotFoundException 
{} 
}
 
From a client I 
basically call the session ejb:
 
PoType po = new 
PoType();
...add all the stuff 
to the object
 
boolean test = 
tester.add(po);
 
When my ejb gets the 
object all the fields are null. What am I missing here?
Can you not pass 
non-ejb objects around? Please help.
 
Kevin Meldorf Systems Analyst WorldTravel BTI 
400 Skokie Blvd Northbrook, IL 60062 Phone: (847) 
480-8340 [EMAIL PROTECTED]


[JBoss-user] Passing structures to an ejb

2001-05-03 Thread Kevin Meldorf (NBK)



I am working on an 
application where I am trying to pass a non ejb ojbect to an 
EJB.
 
I have a session 
bean that I am trying to pass the following "structure" to my session 

bean.
 
import 
java.util.*;import java.io.*;
 
/** This is 
basically a file of structs that we will use in the    Po app 
-- If you are a hard core Java OOP guy please go away :-) 
**/    public class PoType implements Serializable 
{
 
 public 
AddressType billToAddress; public AddressType 
vendorAddress; public AddressType shipToAddress;
 
 public int 
ID; public String poNumber;
 
 public String 
yourName; public String yourPhone; public String 
name; public String phone;
 
 public Date 
dateOfOrder; public String departmentNo; public String 
generalLedgerNumber; public Date dateRequested;
 
 public Vector 
items;  // contains ItemType objects OrderItem
 
    
public float poTotal; public String 
comments;  private void writeObject(java.io.ObjectOutputStream 
out) throws IOException {}    
private void readObject(java.io.ObjectInputStream 
in) throws IOException, ClassNotFoundException 
{} 
}
 
From a client I 
basically call the session ejb:
 
PoType po = new 
PoType();
...add all the stuff 
to the object
 
boolean test = 
tester.add(po);
 
When my ejb gets the 
object all the fields are null. What am I missing here?
Can you not pass 
non-ejb objects around? Please help.
 
Kevin Meldorf Systems Analyst WorldTravel BTI 
400 Skokie Blvd Northbrook, IL 60062 Phone: (847) 
480-8340 [EMAIL PROTECTED]


[JBoss-user] RE: NT Service wrapper

2001-04-16 Thread Kevin Meldorf (NBK)

Hey we're getting closer! I have the service up, but it fails when I try to
shut it down through the services panel. Here's the log output:

Jboss_Tomcat init.c: GetProperties(): debug enabled
Jboss_Tomcat init.c: GetProperties(): jvm.path:
Jboss_Tomcat c:\jdk1.3\jre\bin\hotspot\jvm.dll
Jboss_Tomcat java.c: ServiceStart(): jvmpath picked up from properties
Jboss_Tomcat java.c: ServiceStart(): jvmpath:
Jboss_Tomcat c:\jdk1.3\jre\bin\hotspot\jvm.dll
Jboss_Tomcat java.c: ServiceStop(): connect() failed

Here's my properties file -- what am I missing? I am trying
this on Windows 2000 with service pack 1.

application.parameters=
jvm.parameters=-Djava.class.path=c:\jboss-tomcat-2.1-beta\jboss-2.1\bin\run.
jar
jvm.path=c:\jdk1.3\jre\bin\hotspot\jvm.dll
current.directory=c:\jboss-tomcat-2.1-beta\jboss-2.1\bin
localhost.address=10.11.49.109
mainclass=org/jboss/Main
service.display.name=Jboss_Tomcat
service.name=Jboss_Tomcat
stop.port=1984

debug=yes
log.path=c:\jboss-tomcat-2.1-beta\jboss-2.1\bin\javants.log

Thanks,

Kevin


-Original Message-
From: Heitzso [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 3:43 PM
To: Kevin Meldorf (NBK); [EMAIL PROTECTED]
Subject: NT Service wrapper


  Kevin,

I wrote a version of an NT service wrapper that was contributed to jboss.
I don't know if that's the version you're using.  I'm including a current
service wrapper that's better able to find/use jvms.  Please, if this works,
notify me _and_ the list and I'll make sure the current code gets into
contrib.

Heitzso






___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] NT service from jboss-contrib

2001-04-16 Thread Kevin Meldorf (NBK)

Hello,

I am trying to use the NT service from the contrib section, but I keep on
getting the following error in the log:

JbossTomcat java.c: ServiceStart(): Cannot create JVM
Failed to start service

Does anyone have a working version of this NT service and if you do,
can you post your working .properties file?

Thanks,

Kevin

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Problem with SQL MAX() function in jaws.xml finder

2001-04-11 Thread Kevin Meldorf (NBK)

I had a similiar problem when using a session bean and jdbc.
I fixed it by making sure that I was  doing a "select as" --
maybe this will help with the custom finder?

SELECT MAX(PK_ID) as pk_id FROM PKTABLE.

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] RE: JBOSS NT SERVICE

2001-04-05 Thread Kevin Meldorf (NBK)

I have set up Jboss as an NT service, but it ain't pretty...
You need to go out and get the srvany binary
http://www.href.com/pub/Helpful/SrvAny/

Here you will find the docs and tools that will help you
to set up anything as an NT service. You must let the service
participate with the desktop --otherwise you will not be able 
to stop the service. Also to kill it, ^C does not work, you 
need to kill the entire command prompt window.
 
If there is anyone out there that has a cleaner solution, I wouldn't mind
seeing it...
 
Kevin
 


Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Isolation levels in EJB

2001-04-04 Thread Kevin Meldorf (NBK)

How are Transaction Isolation Levels handled in jboss? Is it possible to set
them (TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, etc.) in a
deployment descriptor? I can't seem to find information on this anywhere and
any help would be greatly appreciated.

Thanks in advance,

Kevin

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Writing a finder which returns max id used

2001-04-03 Thread Kevin Meldorf (NBK)


We handled this by creating an entity bean with the fields table_name (pk)
and next_id and a stateless session bean that has a method returnPK. To deal
with transactional issues the method getNextID is declared a required
transaction
in ejb-jar.xml.

 /** returnPk gets the max id from the pktable adds 1 returns it to the
caller and then updates the pktable with the new highest id */
public Integer returnPk(String tableName) throws NamingException,
FinderException, RemoteException {

Integer pk = null;

pk = getNextId(tableName);
return pk;
}

/** getNextId() is an atomic transaction that will get the nextId
update the pktable and then return the id to the caller. */

private Integer getNextId(String tableName)throws NamingException,
FinderException, RemoteException {
 
Integer oldPk=null;
Integer newPk=null;
int pkInt=-1;

PkEntity pkEnt = home.findByPrimaryKey(tableName);
oldPk = pkEnt.getNextId();
pkInt= oldPk.intValue();
++pkInt;
newPk = new Integer(pkInt);
pkEnt.setNextId(newPk);
return newPk;
}



 snipped of ejb-jar.xml


   
  
 PkSessionBean
 getNextId
  
  Required
   


There is also a more involved project going on through the server-side.com
that you may
want to check out as well. For our needs, however, we feel that the above
method will
work fine.

Hope this helps,

Kevin



Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



FW: [JBoss-user] Transaction Isolation Level

2001-03-30 Thread Kevin Meldorf (NBK)

Yo Marc! If you're still browsing the list,
could you field this one for me???

Thanks
Kevin

-Original Message-
From: Kevin Meldorf (NBK) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 2:06 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Transaction Isolation Level


How are Transaction Isolation Levels handled in jboss? Weblogic
seems to use a proprietary method in their weblogic-ejb-jar file.
If jboss does have a control over Transaction Isolation Levels,
where and how do you declare them.

Thanks,

Kevin

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Transaction Isolation Level

2001-03-29 Thread Kevin Meldorf (NBK)

How are Transaction Isolation Levels handled in jboss? Weblogic
seems to use a proprietary method in their weblogic-ejb-jar file.
If jboss does have a control over Transaction Isolation Levels,
where and how do you declare them.

Thanks,

Kevin

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Client class files dont compile on linux

2001-03-28 Thread Kevin Meldorf (NBK)

oh classpath and compiling problems: Many a day
spent pulling out my hair... 

1. compile the client at the root of your package directory.
   if your files are in com.whatever.foo, make sure that your
   client sits above "com" and also make sure that you have an
   import for your class files.

2. Watch out for j2ee files from sun being in your classpath --
   this has been known to cause problems.

Example:

   My ejb class files were in ~kmeldorf/com/wtp/ejb/security. My
   userTest.java client sits in ~kmeldorf.

   Here are the import statements on my client:
   import javax.naming.*;
   import java.util.*;
   import javax.rmi.*;
   import com.wtp.ejb.security.*;

   Here is the compile statement that I used to compile the client:
   javac -classpath $JBOSS/jboss-tomcat-2.1-beta/jboss2.1/lib/ext/ejb.jar;
./ userTest.java

Hope this helps.

Kevin

Kevin Meldorf
Systems Analyst
WorldTravel BTI
400 Skokie Blvd
Northbrook, IL 60062
Phone: (847) 480-8340
[EMAIL PROTECTED]




   

-Original Message-
From: Yasir [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 1:06 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Client class files dont compile on linux


I am stumped by a serious newbie dilemma. 

Im trying to code my first EJB's and deploy them on JBOSS. All i really want
to do is to be able to see how EJB's work and get the hang of it. So, i
started coding the tutorials in the manuals and on the web. 

In the JBOSS manual example, when i compile the interest classes, the
compile fine. I can also make the JAR file and deploy it in JBOSS. the
server sends out msgs saying its deployed. 

however, when i try compiling the clients, i use this command.

javac -classpath /usr/local/jboss/client/ejb.jar:.InterestClient.java

OR

javac -classpath /usr/local/jboss/lib/ext/ejb.jar:.InterestClient.java

NOtHING happens! no class file is output and no error is given

When i use this command:

javac -classpath /usr/local/jboss/client/ejb.jar  InterestClient.java

I get errors stating the the package com.webtomorrow.interest could not be
imported

I have trid verious combinations of the javac command and JAR files,
classpaths, but i cannot get the client file to compile. 

I am on Linux redhat 7.0 and have installed the latest versions of JDK and
J2EE. could someone PLEASE tell me whats happening and where should i be
looking to fix the error? Many thanks.

YSK

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user