WLS 9.2 - Bug in clientgen task for attribute 'overwrite' - weblogic.developer.interest.webservices.general(Archived)

Hi,
I found that the attribute 'overwrite' doesn't work in <clientgen> ANT task. Instead of not overwriting client component files already present, the task re-produces the files every time.
The reason why is here: (from class ClientGenTask.java)
private boolean needToRun()
{
return true;
}
public void execute()
{
ClassLoader classloader;
validate();
if(!overwrite && !needToRun())
{
return;
}
...
}
Thanx for help, St.
--
Edited by steffen.bartsch at 05/28/2008 4:05 AM

Related

What functionality are you successfully using in your EO SuperClasses?

Hi Everyone:
We are very new to JHeadstart/JDeveloper and have just established the method we are going to use at the Entity Level to convert input to Uppercase by putting the following code into a superclass and extending the .xml files of the entities from EntityImpl to this superclass which we called UWEntityImpl.
What I am wondering is what other ways is this functionality being used by you more experienced JHeadstart Developers? I am trying not to re-invent the wheel and utilize methods that have worked well for you.
Of course I can think of toLowerCase, what else are you using?
Thanks so much in advance.
Mary
U of Windsor
Example Code:
package its.sis.BusinessModel.model;
import oracle.jbo.AttributeDef;
import oracle.jbo.server.EntityImpl;
public class UWEntityImpl extends EntityImpl {
public UWEntityImpl () {
}
// This code converts the inputted string to Uppercase in the database.
// April 27, 2007 mb
protected void setAttributeInternal(int i, Object object) {
Object value = object;
AttributeDef def = getEntityDef().getAttributeDef(i);
if ("true".equalsIgnoreCase((String)def.getProperty("UPPERCASE"))) {
if (value != null && value instanceof String) {
value = ((String)value).toUpperCase();
}
}
super.setAttributeInternal(i, value);
}
}

Programmatic Configuration

Is there a way to do programmatic (i.e. java) configuration in Kodo.
Also, is there a way to programmatically use the tools. For example,
something like this:
SchemaBuilder.buildSchema()
Answered my own question. Perhaps someone from Solarmetric can tell me
if there are any problems with this technique:
public class ShopKodoConfiguration extends JDBCConfigurationImpl {
private Class[] persistentClasses =
{Product.class, Cart.class, CartItem.class};
public ShopKodoConfiguration() throws Exception {
loadDefaults();
setLicenseKey("license key goes here");
setConnectionDriverName("com.mysql.jdbc.Driver");
setConnectionURL("jdbc:mysql://localhost/test");
setLog("DefaultLevel=WARN");
}
public void enhance() throws IOException {
for (Class cls : persistentClasses) {
JDOEnhancer e = new JDOEnhancer(this, cls);
e.enhance();
e.writeBytecode();
}
}
public void map() throws Exception {
for (Class cls : persistentClasses) {
MappingTool mappingTool = new MappingTool(this);
mappingTool.setSchemaAction(SchemaTool.ACTION_REFRESH);
mappingTool.refresh(cls);
mappingTool.record();
mappingTool.buildSchema(cls);
}
}
}
Dave Ford wrote:
Is there a way to do programmatic (i.e. java) configuration in Kodo.
Also, is there a way to programmatically use the tools. For example,
something like this:
SchemaBuilder.buildSchema()
That will work fine for development tasks. As would creating an
instanceof JDBCConfigurationImpl and populating it (rather than
extending it).
Abe White wrote:
That will work fine for development tasks. As would creating an
instanceof JDBCConfigurationImpl and populating it (rather than
extending it).How about in Kodo 4.0? Is there a way to do programmatic configuration
there? As well as enhance and mapping?

8.1 Split Directory Class Loading

I've noticed a feature/bug of WLS 8.1 development using the split directory.
ClassOne.java:
private static String myString = "Original";
public static String getMyString { return myString; }
public static void setMyString(String s) { myString = s; }
ClassTwo.java:
public void doSomething()
{
ClassOne.setMyString("Changed");
}
I build an exploded-ear and call doSomething() on ClassTwo and then call getMyString()
on ClassOne and get the expected "Changed" as a result.
Now I make a change to let's say, ClassThree.java, and compile it using the compile
target from the build.xml file generated by weblogic.BuildXML. Only ClassThree.class
gets copied to the exploded ear directory.
Calling doSomthing() on ClassTwo results in "Original". ClassTwo has been reloaded/initialized.
Is this the expected behavior? I'd like to just reload ClassThree. If I can't
do that, I might as well restart the app which is what I thought the split directory
was supposed to help me avoid.

ParameterBinding on DB2Platform with Toplink11/Eclipselink

Hello,
i try to migrate our application from Toplink9 to Toplink11. For this, i migrate from Toplink9 to Toplink10 and make some performance tests.
The performance tests run well, so i migrate from Toplink10 to Toplink11. After that, i start the performance tests again.
But i found out, that Toplink11 needs more of double of the time as Toplink10. I found out, that the ParameterBinding doesn't works.
But I have configured the Login in a Project correctly.
I use Platform DB2 and as i debug the code, i found in the class DB2Platform this code:
oracle.toplink.platform.database.DB2Platform {
/**
* INTERNAL
* Allows platform to choose whether to bind literals in DatabaseCalls or not.
*/
public boolean shouldBindLiterals() {
return false;
}
}
ExpressionSQLPrinter {
...
public void printPrimitive(Object value)
{
if(value instanceof Collection)
{
printValuelist((Collection)value);
return;
} else
{
session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value);
return;
}
}
}
This method is implemented in the class
DatasourcePlatform {
...
public void appendLiteralToCall(Call call, Writer writer, Object literal)
{
if(shouldBindLiterals())
{
appendLiteralToCallWithBinding(call, writer, literal);
} else
{
int nParametersToAdd = appendParameterInternal(call, writer, literal);
for(int i = 0; i < nParametersToAdd; i++)
((DatabaseCall)call).getParameterTypes().addElement(DatabaseCall.LITERAL);
}
}
}
So i promise, that ParameterBinding with Toplink11 and DB2 only works, if the method shouldBindLiterals() returns true?
Do i have to implement a new class which extends DB2Platform and override the method
public boolean shouldBindLiterals() {
return true;
}
or what is the correct way to use parameter binding with Toplink11 and DB2?
Thank you in advance
Georg 
DB2 requires casting for parameters in some expressions.
The shouldBindLiterals method was introduced to allow the user to define in this situations literals instead of parameters and keep using bindings for parameters.
Since then the casting writeParameterMarker method has been added that I believe fixed the situation.
Please feel free to log a bug; use a custom platform as a workaround.
Thanks,
Andrei 
Hello Andrei,
thank you for your answer.
i will log a bug. Is it better to create one in Toplink-Forum oder better in Eclipselink-forum?
Thanks, Georg 
Please use Eclipse bugzilla https://bugs.eclipse.org/bugs/

Renamer evolution problem

Hi All,
I want to use a renamer mutation to evolve my PersistentProxy, as follows:
Old class and proxy:
class oldMap {
  public oldMap() {}
}
#Persistent(proxyFor=oldMap.class)
class oldMapProxy implements PersistentProxy<Map<K,V>> {
    private K[] keys;
    private V[] values;
    oldMapProxy() {}
    public final void initializeProxy(Map<K, V> map) {
       ...
    }
    public final Map<K, V> convertProxy() {
       ...
    }
}New class and proxy:
class newMap {
  public newMap() {}
}
#Persistent(proxyFor=newMap.class, version=1)
class newMapProxy implements PersistentProxy<Map<K,V>> {
    private K[] keys;
    private V[] values;
    newMapProxy() {}
    public final void initializeProxy(Map<K, V> map) {
       ...
    }
    public final Map<K, V> convertProxy() {
       ...
    }
}In order to evolve the proxy, I added the following renamer mutations:
mutations.addRenamer(new Renamer("oldMapProxy", 0, newMapProxy.class.getName()));
mutations.addRenamer(new Renamer("oldMap", 0, newMap.class.getName()));But I got the error:
com.sleepycat.persist.evolve.IncompatibleClassException: (JE 4.0.103) Invalid mutation: [Renamer Class: oldMap Version: 0 NewName: newMap] For class: oldMap version: 0 New class: newMap version: 0 Error: A new higher version number must be assigned.
I appreciate your help. 
Hi,
Thanks for reporting this. We'll look into it.
I assume this is not critical, since renaming a proxy won't change the names of the classes in your schema / data model. Correct?
--mark                                                                                                                                                                                                                                                                                                                                                                                                            
Hi Mark,
Thank you for looking into this issue. 
Hi,
Eric Wang looked into this last night and our conclusion is that renaming the proxied class (oldMap) is not supported by the DPL. The DPL supports renaming any class that is persistent, so you can rename your proxy class (oldMapProxy).
If you have a class such as oldMap that is under your control (it is your source code), then the right approach is to make it #Persistent so that the DPL can be used to manage class evolution.
Proxies are normally used for classes in external libraries (e.g., java.util.HashMap) for which you do not control the source code. Renaming of these classes is not supported by the DPL.
If you are stuck, you may want to try the following approach. I have not tried it myself, it's just an idea.
+ Create a new proxy for newMap, newMapProxy. This is not an evolution of the oldMapProxy, it is a new proxy for a different class, newMap. Do not add a Renamer for oldMapProxy to newMapProxy.
+ Add a field Converter mutation for the field declared as type oldMap. Your converter will transform the RawObject for oldMapProxy to a RawObject for newMapProxy.
As I say, this would be an experiment and is not guaranteed to work. We have not tried this.
I've noticed that you are doing a lot of class evolution changes for proxies. It would help me to understand why. Normally a proxy class and a proxied class never change. Could you explain more about what you're doing?
Thanks,
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Categories

Resources