View objects referencing the same entity
The behaviour occurs in every version of jdeveloper ADF BC i have tried so far (10g, 11g).
I have 2 updatable view objects referencing the same entity object. When i create a new record using the first view object and before commiting the data to the database i navigate to the second
view object. Suprisingly the second view object is populated with the same data that is posted on the first view object. It seems like both view objects are referencing the same entity object instance.
Is any way to overcome this strange behaviour.
Thanks
As Timo says think of the EO as a record cache. If you had 700 VOs all based on the same EO, it would be ideal to store the same record(s) 700 times in the midtier as it would consume vasts amount of memory. Thus the EO cache.
If you do want to separate the VOs, you've 3 options:
1) Use separate EOs for each VO (not ideal)
2) Expose each VO under their own root level Application Module - a separate EO cache instance for each VO will be created at runtime - however you need to be careful between the VO/EO pairs, you don't update the same record, as you'll get record locks/contention
3) If you're using task flows in 11g, use the Always Begin New Transaction option for each screen/fragment for each VO. This is the equivalent of 2 but from the task flow level - however again you need to be careful on record locks.
CM.
Similar Messages
-
Problem with 2 View Objects based on One Entity -Probably a Bug in ADF BC
Hi
I am using JDeveloper 10.1.3(SU5) and adf faces and ADF BC and to explain my problem I use HR schema.
First, I created 2 view objects based on countries table named as TestView1 and TestView2. I set TestView1 query where clause to region_id=1 and TestView2 query where clause to region_id!=1 in the view object editor and then I created 2 separated form on these 2 view objects by dragging and dropping from data control palette.
Now when I insert a record in the form based on TestView1 with region_id set to 1 and commit the record and go to the next form I can see the record in the second form which is completely wrong since it is against the where clause statement of the second form.
I am really confused and the situation is very wired and it seems to me something like bug in adf bc.Am I right.Is there any work around or solution for solving this problem.
Any help would be highly appreciated.
Best Regards,
NavidDear Frank,
Thank you very much for your quick response.
Reading your helpful comments now I have some questions:
1- I have commited the record in the database so shouldn't the query of view objects be re-queried?
2- We try to use ClearVOCaches (entity_name,false) in afterCommit of the base entity object but unfortunately it does not work correctly. after that,We got root app module and used findViewObject method to find all the view of that entity (we have found them by using name not automaticlly) and called executeQuery of all views. From my point of view it has 2 big disadvantages. First suppose that this entity is an important entity and 4 or 5 viow objects are based on it. Now, For inserting one record we should re-execute 4 or 5 view which I think makes some performance issues. Besides, If during the development one programmer add a new view object based on this entity and don't add the executeQuery in the afterCommit for this view, again we have the same problem. Isn't there at least a way that automatically refresh all related view objects however the performance issue still exists.
3- You mentioned that this issue is handled in the developer guide. Could you kindly give me a refrence which developer guide you mean and which section I should read to overcome this problem.(I have ADF Developer's Guide for Forms/4GL Developer's Guide , however I search for clearVOCaches and surprisingly nothing was found!!!)
4- Could you please give me some hints that from your point of view what is the best method to solve this problem with minimum performance effect.
Any comment would be of some great help.
Thanks in advance,
Navid -
How to make two Application Modules share the same entity cache?
Hello everyone, I am using JDeveloper 11.1.2.3.0
I have a little problem in my application through using two AppModules that contain also same ViewObjects. So to be clear one VO is declared in two AppModules. When I commit the view by using AppModule1 and then go to another page that uses the same VO but from AppModule2, I have to commit again, even through the row is previously stored in the database.
I understood that this came because different AppModules use different entityCache for database communications.
I am asking if anyone knows any option on how to sync the entity caches from the two appmodules, or how to make them use the same entity cache.
Thank youYou can make a copy of the app and give it another name, but it will use the same settings files no matter which you open. Settings aren't stored in the app, but in your Preferences.
Firefox, being a Windows derivative, might have the capability to use "Profiles" where you'd set it up different for each profile. I don't use Firefox, so I don't know if that option exists. -
RE: multiple named objects with the same name andinterface
David,
First I will start by saying that this can be done by using named anchored
objects and registering them yourself in the name service. There is
documentation on how to do this. And by default you will get most of the
behavior you desire. When you do a lookup in the name service (BindObject
method) it will first look in the local partition and see if there is a
local copy and give you that copy. By anchoring the object and manually
registering it in the name service you are programmatically creating your
own SO without defining it as such in the development environment. BTW in
response to your item number 1. This should be the case there as well. If
your "mobile" object is in the same partition where the service object he is
calling resides, you should get a handle to the local instance of the
service object.
Here is the catch, if you make a bind object call and there is no local copy
you will get a handle to a remote copy but you can not be sure which one!
It end ups as more or less a random selection. Off the top of my head and
without going to the doc, I am pretty sure that when you register an
anchored object you can not limit it's visibility to "User".
Sean
-----Original Message-----
From: [email protected]
[<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
Sent: Monday, June 22, 1998 4:51 PM
To: [email protected]
Subject: multiple named objects with the same name and interface
All,
More than once, I have wished that Forte allowed you to place named
objects with the same name in more than one partition. There are two
situations in which this seems desirable:
1) Objects that are not distributed, but are mobile (passed by value to
remote objects), cannot safely reference a Service Object unless it has
environment visibility, but this forces the overhead of a remote method
call when it might not otherwise be necessary. If it were possible to
place a copy of the same Service Object (with user visibility) in each
partition, the overhead of a remote method call could be avoided. This
would only be useful for a service object whose state could be safely
replicated.
2) My second scenario also involves mobile objects referencing a Service
Object, but this time I would like the behavior of the called Service
Object to differ with the partition from which it is called.
This could be accomplished by placing Service Objects with the same name
and the same interface in each partition, but varying the implementation
with the partition.
Does anyone have any thoughts about why this would be a good thing or a
bad thing?
David N. Foote
Consultant
Get Your Private, Free Email at <a href=
"http://www.hotmail.com">http://www.hotmail.com</a>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:<a href=
"http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:<a href=
"http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>David,
First I will start by saying that this can be done by using named anchored
objects and registering them yourself in the name service. There is
documentation on how to do this. And by default you will get most of the
behavior you desire. When you do a lookup in the name service (BindObject
method) it will first look in the local partition and see if there is a
local copy and give you that copy. By anchoring the object and manually
registering it in the name service you are programmatically creating your
own SO without defining it as such in the development environment. BTW in
response to your item number 1. This should be the case there as well. If
your "mobile" object is in the same partition where the service object he is
calling resides, you should get a handle to the local instance of the
service object.
Here is the catch, if you make a bind object call and there is no local copy
you will get a handle to a remote copy but you can not be sure which one!
It end ups as more or less a random selection. Off the top of my head and
without going to the doc, I am pretty sure that when you register an
anchored object you can not limit it's visibility to "User".
Sean
-----Original Message-----
From: [email protected]
[<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
Sent: Monday, June 22, 1998 4:51 PM
To: [email protected]
Subject: multiple named objects with the same name and interface
All,
More than once, I have wished that Forte allowed you to place named
objects with the same name in more than one partition. There are two
situations in which this seems desirable:
1) Objects that are not distributed, but are mobile (passed by value to
remote objects), cannot safely reference a Service Object unless it has
environment visibility, but this forces the overhead of a remote method
call when it might not otherwise be necessary. If it were possible to
place a copy of the same Service Object (with user visibility) in each
partition, the overhead of a remote method call could be avoided. This
would only be useful for a service object whose state could be safely
replicated.
2) My second scenario also involves mobile objects referencing a Service
Object, but this time I would like the behavior of the called Service
Object to differ with the partition from which it is called.
This could be accomplished by placing Service Objects with the same name
and the same interface in each partition, but varying the implementation
with the partition.
Does anyone have any thoughts about why this would be a good thing or a
bad thing?
David N. Foote
Consultant
Get Your Private, Free Email at <a href=
"http://www.hotmail.com">http://www.hotmail.com</a>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:<a href=
"http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:<a href=
"http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>> -
How to rotate and translate an object at the same time??
Hi, I have a problem with rotation and translation of an object at the same time. I wrote a behovior class for my object (a cylinder). When some conditions are true the cylinder is added to a robot arm. Then it is translated so that the cylinder would be very close to the arm (looks like the robot is holding it). And now the behavior should also rotate the cylinder because the angle is 0 and it should be 90. I can translate the object or I can rotate the object but when I'm trying to do it at the same time (I want to combine rotation and translation) it doesn't work.
Could anyone help me, please :)You can used to Matrix3f
This object is a rotation and translate matrix
for example:
private void componerTransformada(){
Quat4f rot = new Quat4f((float) this.getRotacionSobreX(),(float) this.getRotacionSobreY(),
(float) this.getRotacionSobreZ(),1.0f);
Vector3f tras = new Vector3f(-4.0f,-4.0f,(-1)*this.getDistanciaDeLaCamara());
this.setTransformacion(new Transform3D(new Matrix4f(rot, tras, 1.0f)));
Quat4f is a matrix of ratation
vector3f is a direction vector
Transform3d is building with Quat4f and Vector3f.
That is work i use this to situe the view of point.
good locky -
Exporting two remote objects on the same port
Hi,
I would like to export two remote objects on the same host, same port and bind them with different service names.
There is no problem when I do that from the same Java program.
But when I export and bind an object from a Java program 1, I cannot do the same with the second (and similar) Java program 2. This is the stack trace of my Exception:
java.rmi.server.ExportException: Port already in use: 50040; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)Can some one help pleaseIt should work in any version of Java as long as the server socket factories are null or equal according to Object.equals() or its override in the SSF.equals() method if any. Which needs to be present and needs to take the form:
public boolean equals(Object object)
return object != null && object.getClass() == this.getClass();
}with further tests if the server socket factories have additional state. -
Sharing objects in the same package (context)
Hi,
I need a small example or API invocations which shows object sharing beetween two applets in the same package.
Thanks.Look at the JavaPurse sample. You'll see the record, ParameterFile, and CyclicFile are shared objects in the same context.
-
XML document structures must start and end within the same entity
Hi there,
I'm working with a client/server application and using SaxParser for reading in xml. I get the SaxParserException: XML document structures must start and end within the same entity. I understand what that means, but it isn't applicable! The xml data being used is well-formed. I checked the well-formedness with Stylus Studio to make sure. Here's the data:
<?xml version='1.0' encoding='UTF-8'?>
<vcmessage>
<vcsource>3</vcsource>
<processevent>16</processevent>
<shape>
<llindex>0</llindex>
<shapetype>9</shapetype>
<shapeproperties>
<shapelocation>
<xcoord>54</xcoord>
<ycoord>184</ycoord>
</shapelocation>
<bounds>
<width>24</width>
<height>24</height>
</bounds>
<fgcolor>
<fgred>0</fgred>
<fggreen>0</fggreen>
<fgblue>0</fgblue>
</fgcolor>
<bgcolor>
<bgred>255</bgred>
<bggreen>255</bggreen>
<bgblue>255</bgblue>
</bgcolor>
<thickness>1</thickness>
<isfilled>false</isfilled>
</shapeproperties>
</shape>
</vcmessage>The parser generally stops around the </bgcolor> tag.
I'm using Eclypse as my IDE. I'm wondering if there's something wrong with it? Or maybe there's something wrong with the class I'm using for reading in the XML? Followng is the class.
Please advise,
Alan
package vcclient;
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
public class XMLDocumentReader extends DefaultHandler
private VCClient client = null;
private Writer out;
private String lineEnd = System.getProperty("line.separator");
private boolean haveSourceType = false;
private boolean haveUserName = false;
private boolean haveMessage = false;
private boolean haveProcessEvent = false;
private boolean haveLinkedListIndex = false;
private boolean haveOpeningShapePropertiesTag = false;
private boolean haveShapeType = false;
private boolean haveOpeningShapeLocationTag = false;
private boolean haveShapeLocation = false;
private boolean haveOpeningXCoordTag = false;
private boolean haveOpeningYCoordTag = false;
private boolean haveOpeningBoundsTag = false;
private boolean haveBoundsWidth = false;
private boolean haveBoundsHeight = false;
private boolean haveOpeningFGColorTag = false;
private boolean haveOpeningBGColorTag = false;
private boolean haveOpeningThicknessTag = false;
private boolean haveOpeningIsFilledTag = false;
private boolean haveOpeningImageDataTag = false;
private boolean haveOpeningTextDataTag = false;
private boolean haveFGRed = false;
private boolean haveFGGreen = false;
private boolean haveFGBlue = false;
private boolean haveBGRed = false;
private boolean haveBGGreen = false;
private boolean haveBGBlue = false;
private boolean haveThickness = false;
private boolean haveIsFilled = false;
private boolean haveImageData = false;
private boolean haveTextData = false;
private VCMessage vcmessage = null;
public XMLDocumentReader(VCClient value)
client = value;
vcmessage = new VCMessage();
public VCMessage getVCMessage()
return vcmessage;
public boolean haveSourceType()
return haveSourceType;
public boolean ParseXML(InputStream stream)
boolean success = false;
// Use the default (non-validating) parser
SAXParserFactory factory = SAXParserFactory.newInstance();
try
// Set up output stream
out = new OutputStreamWriter(System.out, "UTF-8");
// Parse the input
SAXParser saxParser = factory.newSAXParser();
saxParser.parse( stream, this );
success = true;
catch (SAXParseException spe)
// Error generated by the parser
System.out.println("\n** Parsing error"
+ ", line " + spe.getLineNumber()
+ ", uri " + spe.getSystemId());
System.out.println(" " + spe.getMessage() );
// Unpack the delivered exception to get the exception it contains
Exception x = spe;
if (spe.getException() != null)
x = spe.getException();
x.printStackTrace();
return success;
catch (SAXException sxe)
// Error generated by this application
// (or a parser-initialization error)
Exception x = sxe;
if (sxe.getException() != null)
x = sxe.getException();
x.printStackTrace();
return success;
catch (ParserConfigurationException pce)
// Parser with specified options can't be built
pce.printStackTrace();
return success;
catch (Throwable t)
t.printStackTrace();
return success;
return success;
public void startDocument()throws SAXException
emit("<?xml version='1.0' encoding='UTF-8'?>");
nl();
public void endDocument()throws SAXException
try {
nl();
out.flush();
} catch (IOException e) {
throw new SAXException("I/O error", e);
public void startElement(String namespaceURI,
String lName, // local name
String qName, // qualified name
Attributes attrs)throws SAXException
String eName = lName; // element name
if (eName.equals(""))
eName = qName; // namespaceAware = false
emit("<"+eName);
if (attrs != null) {
for (int i = 0; i < attrs.getLength(); i++) {
String aName = attrs.getLocalName(i); // Attr name
if (aName.equals("")) aName = attrs.getQName(i);
emit(" ");
emit(aName + "=\"" + attrs.getValue(i) + "\"");
emit(">");
if(makeStartTag(eName).equals(Constants.OPENING_SHAPEPROPERTIES))
haveOpeningShapePropertiesTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_SHAPELOCATION))
haveOpeningShapeLocationTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_BOUNDS))
haveOpeningBoundsTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_FGCOLOR))
haveOpeningFGColorTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_BGCOLOR))
haveOpeningBGColorTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_BGGREEN))
System.out.println("See BGGreen");
else if(makeStartTag(eName).equals(Constants.OPENING_BGBLUE))
System.out.println("See BGBlue");
else if(makeStartTag(eName).equals(Constants.OPENING_THICKNESS))
haveOpeningThicknessTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_ISFILLED))
haveOpeningIsFilledTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_IMAGEDATA))
haveOpeningImageDataTag = true;
else if(makeStartTag(eName).equals(Constants.OPENING_TEXTDATA))
haveOpeningTextDataTag = true;
public void endElement(String namespaceURI,
String sName, // simple name
String qName // qualified name
)throws SAXException
if(sName.equals("") && !qName.equals(""))
sName = qName;
emit("</"+sName+">");
else
emit("</"+sName+">");
if(makeEndTag(sName).equals(Constants.CLOSING_SOURCE_TYPE))
haveSourceType = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_USER))
haveUserName = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_MESSAGE))
haveMessage = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_PROCESSEVENT))
haveProcessEvent = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_LINKEDLISTINDEX))
haveLinkedListIndex = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_SHAPETYPE))
haveShapeType = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_SHAPELOCATION))
haveOpeningShapeLocationTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_WIDTH))
haveBoundsWidth = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_HEIGHT))
haveBoundsHeight = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_BOUNDS))
haveOpeningBoundsTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_FGRED))
haveFGRed = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_FGGREEN))
haveFGGreen = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_FGBLUE))
haveFGBlue = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_FGCOLOR))
haveOpeningFGColorTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_BGRED))
haveBGRed = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_BGGREEN))
haveBGGreen = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_BGBLUE))
System.out.println("See closing BGBlue");
haveBGBlue = true;
else if(makeEndTag(sName).equals(Constants.CLOSING_BGCOLOR))
haveOpeningBGColorTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_THICKNESS))
System.out.println("XMLDocumentReader: Step2");
haveOpeningThicknessTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_ISFILLED))
haveOpeningIsFilledTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_IMAGEDATA))
haveOpeningImageDataTag = false;
else if(makeEndTag(sName).equals(Constants.CLOSING_TEXTDATA))
haveOpeningTextDataTag = false;
private String makeStartTag(String tag_name)
String start = "<";
String end = ">";
return start.concat(tag_name).concat(end);
private String makeEndTag(String tag_name)
String start = "</";
String end = ">";
return start.concat(tag_name).concat(end);
public void characters(char buf[], int offset, int len)throws SAXException
String s = new String(buf, offset, len);
if(haveSourceType == false)
if(vcmessage.getSourceType() == null)
try
if(s.equals(""))return;
int sourcetype = Integer.parseInt(s);
vcmessage.setSourceType(sourcetype);
catch(NumberFormatException nfe){}
else if(vcmessage.getSourceType() == SourceType.CHAT_SOURCE)
if(vcmessage.getSourceType() == SourceType.CHAT_SOURCE && haveUserName == false)
vcmessage.setUserName(s);
else if(vcmessage.getSourceType() == SourceType.CHAT_SOURCE && haveMessage == false)
//When the parser encounters interpreted characters like: & or <,
//then this method gets invoked more than once for the whole message.
//Therefore, we need to concatonate each portion of the message. The
//following method call automatically concatonates.
vcmessage.concatMessage(s);
else if(vcmessage.getSourceType() == SourceType.WHITEBOARD_SOURCE)
if(haveProcessEvent == false)
try
vcmessage.setProcessEvent(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveLinkedListIndex == false)
try
vcmessage.setLinkedListIndex(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveShapeType == false)
try
vcmessage.setShapeType(Integer.parseInt(s));
catch(NumberFormatException nfe){}
if(haveOpeningShapePropertiesTag)
if(haveOpeningShapeLocationTag)
if(haveOpeningXCoordTag)
try
vcmessage.setXCoordinate(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveOpeningYCoordTag)
try
vcmessage.setYCoordinate(Integer.parseInt(s));
//reset all flags for ShapeLocation, X and Y coordinates
haveOpeningXCoordTag = false;
haveOpeningYCoordTag = false;
//haveOpeningShapeLocationTag = false;
catch(NumberFormatException nfe){}
else if(haveOpeningBoundsTag)
if(haveBoundsWidth == false)
try
vcmessage.setBoundsWidth(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveBoundsHeight == false)
try
vcmessage.setBoundsHeight(Integer.parseInt(s));
//reset flag
//haveOpeningBoundsTag = false;
catch(NumberFormatException nfe){}
else if(haveOpeningFGColorTag)
if(haveFGRed == false)
try
vcmessage.setFGRed(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveFGGreen == false)
try
vcmessage.setFGGreen(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveFGBlue == false)
try
vcmessage.setFGBlue(Integer.parseInt(s));
//reset flag
//haveOpeningFGColorTag = false;
catch(NumberFormatException nfe){}
else if(haveOpeningBGColorTag)
if(haveBGRed == false)
try
vcmessage.setBGRed(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveBGGreen == false)
try
vcmessage.setBGGreen(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveBGBlue == false)
{ System.out.println("getting BGBlue data");
try
vcmessage.setBGBlue(Integer.parseInt(s));
//reset flag
//haveOpeningBGColorTag = false;
catch(NumberFormatException nfe){}
else if(haveOpeningThicknessTag)
try
vcmessage.setThickness(Integer.parseInt(s));
catch(NumberFormatException nfe){}
else if(haveOpeningIsFilledTag)
vcmessage.setIsFilled(s);
else if(haveOpeningImageDataTag && vcmessage.getProcessEvent() == org.jcanvas.comm.ProcessEvent.MODIFY)
vcmessage.setBase64ImageData(s);
else if(haveOpeningTextDataTag && vcmessage.getProcessEvent() == org.jcanvas.comm.ProcessEvent.MODIFY)
vcmessage.setTextData(s);
//reset
haveOpeningShapePropertiesTag = false;
emit(s);
//===========================================================
// Utility Methods ...
//===========================================================
// Wrap I/O exceptions in SAX exceptions, to
// suit handler signature requirements
private void emit(String s)throws SAXException
try {
out.write(s);
out.flush();
} catch (IOException e) {
throw new SAXException("I/O error", e);
// Start a new line
private void nl()throws SAXException
try {
out.write(lineEnd);
} catch (IOException e) {
throw new SAXException("I/O error", e);
//treat validation errors as fatal
public void error(SAXParseException e)
throws SAXParseException
throw e;
// dump warnings too
public void warning(SAXParseException err)
throws SAXParseException
System.out.println("** Warning"
+ ", line " + err.getLineNumber()
+ ", uri " + err.getSystemId());
System.out.println(" " + err.getMessage());
}Just out of curiosity what happens if you append a space to the end of the XML document?
-
Call to a remote object in the same JVM
Hi,
I want to implement a logging mechanism in my system. I'm planning to
write an rmi object and make it a start up class.
I wud like to know whether the calls to this start up class made by the
ejb instances and from the servlet engine in the same JVM, wud be rmi calls
or wud they be simple method calls.
Does weblogic detect the calls from the objects of the same jvm and
optimise them, or wud they be rmi calls only.
btw, i'm using weblogic 5.1
thx,
ManoharTry:
initialNamingContext.rebind("single",
weblogic.rmi.server.UnicastRemoteObjcet.exportObject(obj)
"M. Manohar" wrote:
Hi Eduardo,
thx for ur reply.
I wud like to know how to make this "binding a stub".
wat i'm using is binding an object only.
Instantiating an object which implements the remote interface and binding
it to the JNDI tree by,
initialNamingContext.rebind("single", obj);
and ofcourse defining it as a start up class in the weblogic.properties
file.
Can u pls explain how to do "binding a stub"
thx,
Manohar
Eduardo Ceballos wrote in message <[email protected]>...
Presuming that the start up class binds itself into the jndi tree, then itonly depends on what you bind: binding a stub results in the RMI runtime
overhead; binding the object itself, results in the simpler function call
overhead.
"M. Manohar" wrote:
Hi,
I want to implement a logging mechanism in my system. I'm planning to
write an rmi object and make it a start up class.
I wud like to know whether the calls to this start up class made by the
ejb instances and from the servlet engine in the same JVM, wud be rmi
calls
or wud they be simple method calls.
Does weblogic detect the calls from the objects of the same jvm and
optimise them, or wud they be rmi calls only.
btw, i'm using weblogic 5.1
thx,
Manohar -
How to create an object within the same class???
hi im just a newbie
i v been always creating an object from the main class..
but how to create an object inside the same class??
i got main and students class
the main got an array
Students[] stu = new Students[]
and i got
stu[i] = new Students(id,name);
i++;
but i wanna do these things inside the Students class..
i tried ..but i got errors.....
how to do this
.javaexpert, :)
I really have no idea what you are trying to do since you say you've always been creating an object from the main class, yet you always want to create an object inside the same class.
I'll assume that you have an object in the main class that you are trying to access from the Students class.
If you are trying to access objects that are contained within the main class FROM the Students class, then know that there are two ways of doing so, one being static, and the other dynamic (look up definitions if unclear):
1.) make the objects in the main class both static and public and access the the objects using a convention similiar to: Main.object; It's important to note that Main is the name of your main class, and object is a static object. There are better ways of doing this by using gettter/setter methods, but I'll omit that tutorial.
2.) Create a new instance of the main class and access the objects using a similiar fashion: Main myInstance = new Main(); myInstance.myObject;
You should really use getter and setter methods but I'll omit the code. In terms of which approach is better, step one is by far.
I don't mean to be condecending, but you should really brush up on your programming skills before posting to this forum. This is a fundamenetal concept that you will encounter time and time again. -
How to set Where clause in the View Object of the MessageChoice ?
Hi,
How to set Where clause in the View Object of the
MessageChoice ?
Example:
<bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
definition="ed00050.Ed00050Module"
releaseMode="stateful" >
<bc4j:viewObjectDef name="EdEscolaCampusView1" >
<bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
<bc4j:propertyKey name="key" />
</bc4j:rowDef>
</bc4j:viewObjectDef>
<bc4j:viewObjectDef name="ListaTipLocalView1"
rangeSize="9999">
</bc4j:viewObjectDef>
</bc4j:rootAppModuleDef>
</bc4j:registryDef>
messageChoice declaration:
<bc4j:messageChoice name="SeqTipoLocalCampus"
attrName="SeqTipoLocalCampus"
prompt="Local do Campus">
<contents>
<bc4j:optionList attrName="SeqTipoBasico"
textAttrName="NomTipoBasico"
voName="ListaTipLocalView1"/>
</contents>
</bc4j:messageChoice>
I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
thanks...
DaniloHi Andy,
I try set a where clause using the message:
Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
//Nome da Package da Tela Detail
package br.com.siadem.siaed.ed00050;
// Importa as Bibliotecas necessárias
import oracle.jbo.ViewObject;
import oracle.jbo.ApplicationModule;
import oracle.jbo.client.Configuration;
import oracle.cabo.servlet.BajaContext;
import oracle.cabo.servlet.Page;
import oracle.cabo.servlet.event.PageEvent;
import oracle.cabo.servlet.event.EventResult;
import oracle.cabo.data.jbo.servlet.bind.*;
import oracle.cabo.ui.data.BoundValue;
import oracle.cabo.ui.data.DataBoundValue;
import javax.servlet.http.HttpServletRequest;
import br.com.siadem.siaed.util.*;
import javax.servlet.http.Cookie;
import oracle.cabo.data.jbo.def.NestedAppModuleDef;
import oracle.cabo.data.jbo.def.ViewObjectDef;
import oracle.cabo.data.jbo.def.AppModuleDef;
// Classe que configura os parametros para a execução da Query,
// utilizando variáveis de Sessao
public class FunPreQueryLista
public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
// TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
// Ex: CodCliente, CodMunicipio etc...
TrataDadosSessao varDadosSessao = new TrataDadosSessao();
// 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
// <alterar>
String valor1 = varDadosSessao.getCodCliente();
String valor2 = varDadosSessao.getCodMunicipio();
//Cria o objeto que retorna o ApplicationModule
ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
// Início das Configurações da Query da Lista
//Cria o objeto que retorna o view object da lista desejada
//alterar
ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
//Configuração dos parametros definidos na query do view Object
//alterar
TipoLocal.setWhereClauseParam(0,valor1);
TipoLocal.setWhereClauseParam(1,valor2);
// Executa a Query
TipoLocal.executeQuery();
// Fim das Configurações da Query da Lista
// Início das Configurações da Query da Lista
//Cria o objeto que retorna o view object da lista desejada
//alterar
ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
//Configuração dos parametros definidos na query do view Object
//alterar
TipoDestLixo.setWhereClauseParam(0,valor1);
TipoDestLixo.setWhereClauseParam(1,valor2);
// Executa a Query
TipoDestLixo.executeQuery();
// Fim das Configurações da Query da Lista
// Retorna o Resultado para a Página
return new EventResult(page);
The code works very well...
And, I'm sorry for my two repost's in UIX Forum about this in a few time.
Thank very much...
Danilo -
How to avoid two threads creating the same entity?
I seem to have a problem with a race-condition. Two threads are trying to
create the same entity. One thread calls a finder with no success and
creates the entity, meanwhile - before the entity gets persisted
(ejbStore()) - the other thread also calls a finder with no success,
creating the
same entity.
My transaction isolation level in the weblogic-ejb-jar.xml is
<transaction-isolation>
<isolation-level>TRANSACTION_READ_UNCOMMITTED</isolation-level>
<method>
<ejb-name>ejb</ejb-name>
<method-name>*</method-name>
</method>
</transaction-isolation>
I've also tried <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
with no significant change in behavior.
In the ejb-jar.xml
<container-transaction>
<method>
<ejb-name>ejb</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
Try setting delay-updates-until-end-of-tx to false for your bean. Try experimenting
with concurrency-strategy of Exclusive. Or re-write your code to not check for
existence before creation; just create the bean and let the db return a duplicate
key exception.
simon.
"Daniel" <[email protected]> wrote:
>I seem to have a problem with a race-condition. Two threads are trying
>to
>create the same entity. One thread calls a finder with no success and
>creates the entity, meanwhile - before the entity gets persisted
>(ejbStore()) - the other thread also calls a finder with no success,
>creating the
>same entity.
>
>My transaction isolation level in the weblogic-ejb-jar.xml is
><transaction-isolation>
><isolation-level>TRANSACTION_READ_UNCOMMITTED</isolation-level>
><method>
><ejb-name>ejb</ejb-name>
><method-name>*</method-name>
></method>
></transaction-isolation>
>
>I've also tried <isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
>with no significant change in behavior.
>
>In the ejb-jar.xml
><container-transaction>
><method>
><ejb-name>ejb</ejb-name>
><method-name>*</method-name>
></method>
><trans-attribute>Required</trans-attribute>
></container-transaction>
>
>
-
How to select the objects sharing the same appearance in the same artboard?
I have several artboards in the file and I want to select all the objects having the drop shadow effect in the artboards I'm working. No matter I use the "Select" in the menu or the "Select similar objects" button in the control panel, it selects all the objects having the same appearance in the entire canvas, not only the one in the artboard I'm working. Any means or there's nothing can do?
Please help!J_Lai wrote:
yes, that's work and I also tried to lock the objects in another artboard in order to select the objects in the working artboard only. However, I think that's stupid to get it done in this way and Adobe should improve this in the next version.
This is easy enough to state but if you think this is wrong then you should perhaps suggest a way this feature could be manifested.
For instance to you this should only effect the current artboard but there will come along another user who will say hey wait a minute I need to select all the drop shadowed objects and remove them now I have to go from atboard to artboard.
If you see what I mean, II found out that when I find something that is seemingly stupid that in fact there is a reason for it and there has to be a way to describe how it can be improved without breaking what you already have.
For instance you want it to just effect the current artboard but then there will be those who also want it if it even touches the artboard and those who will want it on a range of atboards and those who will actually want AI to know which artboards you want even without you specifying which artboards. That last one sounds illogical but that is the nature of the problem and the human conditions.
So though I agree this can be improved perhaps you have an idea how this can work for everyone? -
MVC - More then one view managed by the same contrler.
Ok, I have been reading and searching examples on the MVC .. but all the examples show just what to do when you have just one view of the model. What I f I have the more the n one view to handle the same model.
As we know the views would need to be registerd inside the controler? How can I do this If I have more then one view?
does anyone have any ideas!?
Would it still be correct if when an action occures on my view instead of the controler capturing that event an handiling, I make my view call the controler to handle it?So in your opinion is it ok if I call my controler from the action event of my button?
I just did a small example below:
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.awt.event.ActionListener;
public class Starter extends JFrame{
private Model myModel = new Model();
private Controler myControler = new Controler(myModel);
public Starter(){
JButton myButton = new JButton("Test");
myButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
myControler.makeAction("Hello");
this.getContentPane().add(myButton);
this.pack();
this.show();
public static void main(String[] args){
new Starter();
}As you can see I am calling the controler to manage the new data from the action event of 'myButton' !
Is the above code ok with the spirit of the MVC? -
1) Is there a function to make all the object to the same size?
1) Is there a function to make all the object to the same size?
Solved!
Go to Solution.Sorry, I thought you wanted to align the objects.
We don't have the function to make objects to same size. You have to edit them one by one. To edit the .lks file can be more efficient.
Ryan Shi
National Instruments
Maybe you are looking for
-
Inactive Trade Lines - Close or let it ride til the Creditor closes it?
Hello all: Thanks to the advice of the forum I have had great advances in my credit worthiness. At this juncture there are several trade lines that I am not using and expect to go inactive. I know that the creditors decide when they stop reporting an
-
Google Calendar - can't edit or delete shared calendar events
I have several shared calendars on my Google Apps account. I created all calendars and have full sharing and edit rights on each. I'm using webOS 3.0.2 on my Touchpad, and I can see my shared calendars. However, when I use the webOS calendar I do not
-
hi ..... i'm asking about solution for my problem which is how can i let my browser (explorer oR Netscape) to read from file and write to file in my pc.. my applet is working with AppletViewer which i can read and write to file in my pc ,but when i l
-
I have a PKI solution that is running with the company that I work for (authentiation purposes only) and I had to have that certificate revoked and a new one generated due to the token breaking that the certificate sat. After I had that done I can no
-
I have the new iPhone 5, I found out that lte signal has only 2 or 3 bars, but if I turn the lte off, 3G has 5 full bars, in the same spot. I don't know if it's a software issue or I have a bad phone. I'm on verizon network in Chicago. I wonder if ot