Re: SDO: some question while using sdo with EJB

2007-11-30 Thread Jean-Sebastien Delfino

[snip]
kelvin goodson wrote:

Hello again,
  thanks for your questions. With regards to your first question,  I
think it's basically the same answer as I posted earlier today,  that
you can create an ObjectInputStream associated with an arbitrary
HelperContext.

However, as an aside, I realised in my earlier response that I perhaps
slightly misrepresented the SDO API's capability,  saying that it has
no way to deal with your issue.  That's a slight inaccuracy, since we
are using SDO's API to read the object,  but just providing a
customised ObjectInputStream,  so I should have said that the SDO API
has no explicit means of solving the issue,  but currenlty relies on
implementations to do the kind of thing we have done by providing a
specialised ObjectInputStream.



Coincidentaly I'm starting to work on an SCA application that is going 
to call an EJB running on Geronimo from an SCA composition and I want to 
be able to send SDOs to the EJB at some point. It looks like my use case 
is similar to Eg's use case.


My EJB container is not SDO-aware and therefore is not going to use a 
customized SDO-aware ObjectInputStream... So is there any other way to 
get the SDO deserialized with the default JDK non-SDO-aware 
ObjectInputStream?


The other related question is. In such a server environment what are the 
possible scopes for SDO metadata? thread? classloader? can I define new 
scopes?


Thanks.

--
Jean-Sebastien

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Running Cpp BigBank

2007-11-30 Thread Максим Харичкин
Hello, I ask you about Cpp BigBank  Sample [SCA Native Milestone release 3].  

1. I downloaded and deployed binary release for Windows. After that I used 
Visual C++ 2005 for building source sample (in release mode) and then started 
the runclient.bat. The process was broken with this comment:
"
 C:\Tuscany_SCA\samples\CppBigBank\deploy\bigbank.client>runclient.bat
 Using SCA installed at C:\Tuscany_SCA
 Using SDO installed at C:\Tuscany_SDO
 Using Axis2C installed at C:\axis2c
 Currency is : EURO
 Currency is : EURO

 This application has requested the Runtime to terminate it in an unusual way.
 Please contact the application's support team for more information.
"

2. Then I downloaded and deployed sourse release for Windows. After that I used 
Visual C++ 2005 for building source sample (in debug mode) and started 
debugging with parameters. 

The process was broken, because it couldn't find dll libraries. I changed 
debugging properties in bigbank.client project (set Enviroment) and then the 
process was broken with this comment:
"
 804:1476 Unable to load composite: Instantiation of abstract type 
:http://www.osoa.org/xmlns/sca/1.0  Binding Exception
 Class:   SystemConfigurationException
 Description: Composite not found: bigbank.account
 Origin:
   File:
c:\tuscany_sca\runtime\core\src\tuscany\sca\model\modelloader.cpp
   Line:328
   Function:tuscany::sca::model::ModelLoader::addComponent
 Path:
   File:  
c:\tuscany_sca\runtime\extensions\cpp\src\osoa\sca\compositecontext.cpp
   Line:  101
   Function:  osoa::sca::CompositeContext::getCurrent
"

I have some questions:

1. Why this sample can't find dll libraries in debug mode? 
2. Hou to run this sample in both cases?
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SDO: some question while using sdo with EJB

2007-11-30 Thread kelvin goodson
Hello again,
  thanks for your questions. With regards to your first question,  I
think it's basically the same answer as I posted earlier today,  that
you can create an ObjectInputStream associated with an arbitrary
HelperContext.

However, as an aside, I realised in my earlier response that I perhaps
slightly misrepresented the SDO API's capability,  saying that it has
no way to deal with your issue.  That's a slight inaccuracy, since we
are using SDO's API to read the object,  but just providing a
customised ObjectInputStream,  so I should have said that the SDO API
has no explicit means of solving the issue,  but currenlty relies on
implementations to do the kind of thing we have done by providing a
specialised ObjectInputStream.

As to your second question,  If I understand it correctly  you are
addressing similar issues to Christian as reported here
https://issues.apache.org/jira/browse/TUSCANY-1113.  It's worth
following the link in Christian's JIRA through to the earlier
discussions on the mailing list, since updating types and namespaces
has its pitfalls.  However,  I think if you create your HelperContexts
using the org.apache.tuscany.sdo.api.SDOHelper#createHelperContext(boolean)
method that was introduced as part of the fix for that JIRA then I
think that may get you along the way to solving your issues.

Regards, Kelvin.


On 30/11/2007, EG Koron <[EMAIL PROTECTED]> wrote:
> Recently I have used sdo in my works.In my works distributed EJB component 
> will cooperate with each other while using sdo as parameter. While using the 
> SDO, I find that
>
> 1)If each EJB create it's own scope(HelpContext), and define types in . So 
> while EJB container received incoming calling and UnSerialize Object , a 
> "type not found" exception raised.
>
> After  checking the source code in JDK and SDO, I find the while calling 
> ObjectOutputStream.writeObject(), JDK will call the writeReplace Method in 
> DataObjectImpl, and the DataObjectImpl.writeReplace will return a 
> ExternalizableDelegator whose target is set as the DataObject itself. However 
> while ObjectInputStream.readObject(), JDK will just create a 
> ExternalizableDelegator whose target is set null. so by default, all type 
> info will got from default scope. so the "type not found" exception raised;
>
> So Is there some way could choice the scope, that I have not seen in SDO?
>
> 2) If all EJB in one JavaVM using same the default scope to store metadata, 
> but while I change the xsd(store type description), and redeploy the EJB , 
> then using xsdHelper.define() to redefine the changed xsd. I found the 
> changed type isnot been update in default scope.
>
> So is there some way I could control xsdHelper.define() to update type info
>
> Thanks
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SDO : could I choice the scope(helpcontext) while unserialize dataobject from inputstream

2007-11-30 Thread kelvin goodson
Hi,
   SDO Itself doesn't have a way to handle this at the moment, but
Tuscany has a method in the SDOHelper interface

public ObjectInputStream createObjectInputStream(InputStream
inputStream, HelperContext helperContext) throws IOException;

that allows you to associate a selected HelperContext with an input stream.


You'll find this interface in the lib project, in the
org.apache.tuscany.sdo.api package.

Regards, Kelvin.

On 30/11/2007, EG Koron <[EMAIL PROTECTED]> wrote:
> I could serialize SDO DataObject whose type meta-data stored in a NotDefault 
> context.
> But when I unserialize it from inputStream, a "type not find" exception will 
> raised because default Context is choosed
> So Is there any way that I could choice the context or target while reading 
> DataObject from inputStream ?
>
> HelperContext scope = SDOUtil.createHelperContext(); //a No Default Context
> scope.getXSDHelper().define(...) //define type from xsd in the scope
>
> DataObject origin = scope.getDataFactory().create(...) //create then 
> initialize a do
> do.set(...)
>
> ByteArrayOutputStream bos = new ByteArrayOutputStream(bos);
> ObjectOutputStream out = new ObjectOutputStream(bos);
> out.writeObject(do)
> out.close();
>
> ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
> /*
> following, a "cannot found type" Exception caused. As by default, it can only 
> read type from default Scope
> So could I choise the scope when I reading object from InputStream ???
> */
> DataObject do = (DataObject)new ObjectInputStream(bis).readObject();
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SDO : could I choice the scope(helpcontext) while unserialize dataobject from inputstream

2007-11-30 Thread EG Koron
I could serialize SDO DataObject whose type meta-data stored in a NotDefault 
context. 
But when I unserialize it from inputStream, a "type not find" exception will 
raised because default Context is choosed
So Is there any way that I could choice the context or target while reading 
DataObject from inputStream ?

HelperContext scope = SDOUtil.createHelperContext(); //a No Default Context
scope.getXSDHelper().define(...) //define type from xsd in the scope

DataObject origin = scope.getDataFactory().create(...) //create then initialize 
a do
do.set(...)

ByteArrayOutputStream bos = new ByteArrayOutputStream(bos);
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(do)
out.close();

ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
/*
following, a "cannot found type" Exception caused. As by default, it can only 
read type from default Scope
So could I choise the scope when I reading object from InputStream ???
*/
DataObject do = (DataObject)new ObjectInputStream(bis).readObject();