Zkr Ryz

Ranch Hand
+ Follow
since Jan 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Zkr Ryz

Hey Rob.

As for the question, it is not.

I had a question from this guy from college that is learning Java.

I could't find a better place to upload the code but here.

I hope it's ok.

Originally posted by Rob Prime:
Zkr Ryz,

Check your private messages please.


As for this thread, what's your question? I just see a lot of code.

16 years ago
A swing code sample below. Very basic.


[ June 11, 2008: Message edited by: Zkr Ryz ]
16 years ago

Originally posted by Joe Russo:
Does anybody know what the minimal requirement is from Hibernate 3.1.3?
I am getting an OutOfMemory error with no specific error that would lead to some other error. Currently we have it set for maximum memory for 128m and minimum for 32m.

Any help would be appreciated.
Thanks.
Joe



Probably is not Hibernate but the data you are loading. Are you fetching already something?
Quick question.
Anyone knows where in Hibernate the framework computes the values that had changed?

Does even Hibernate does that or only updates with all the values present in the bean?

p.s. Dear Sheriff or Bartender. This is technically a different question than my previous, and posting this way I have more chances to get an answer.
Hello ranchers.

I'm facing a new challenge in my current project and I have STFW and didn't find anything that look appropiate.

The problem is this.

We are using Hibernate, and when the entities are sent to the client they are transformed into a "lightweight" version of the mapped bean. We do this to remove unneeded fields like "update_timestamp", updateBy, create_date and some others.

In some many - many we add the collection directly to the master so it looks like 1 to many relationship


We do this, mainly to reduce the network overhead when some data is not needed anyway in the server.

So, this is working well so far.

The GUI has the new vo, and changes 1 field , the name.

Then when sent back to the server, only that field should be sent ( again , due to the network )

So if we have a Product with 15 field, of which 10 are relevant to the UC , we send only those 10, and when of those 10 only 1 is updated , the client send to the server only that 1.

That worked fine for that solely entity, back in the server, we fetch the product again, and we set the new name, and hibernate creates the SQL with the "update product set name = ? where product_id = ? "

Ok???

This worked so well, because we reduce significantly the bandwidth consumption.

Now we want to do the same approach for another module where some 30 different entities with 10 - 15 attributes may be updated in the client.

This makes a whole different problem in terms of codification. When we had only 1 with 10 fields it was quite straight forward to know what have changed, and in the server we know very fast ( in terms of coding ) what value to set.

Now with this new requirement, we would have to validate some ( mmhhh 30 * 15 ) ... 400+ fields Arrghh!!!..

So what I'm thinking ( are you still reading this anyway? he ) is to create some "delta detection" mechanism similar to the one that hibernate uses in the client, to know what have changed, then send only those changes in back to the server, and then using the same mechanism, set those values to the mapped bean and let the Hibernate do its work.


We cannot send the whole object back for the network.
We cannot just sent a copy of the object with with a single field with value and the other in null and because Hibernate nullifies all the other values.

And here is the question... does anyone knows how to perform this kind of stuff? I mean Hibernate or other ORM ( Cayenne, Toplink ) should have some "component" that performs the deltas.

So far I have a custom UnitOfWork where I have the registerNew, registerDelete, registerUpdate methods and that's a good starting point. The next step is to create this "delta detection" component by using heavily the reflection api, either directly with java.lang.reflect or some Apache common bean utils or something like that.


I think on upon object retrieval from the server create a copy with the clean state, let the gui manipulate whatever it needs, and before submission to the server take the dirty and compare it with the clean and calculate the deltas. Is not that it may be too hard, but if there is anything that already does the job, why don't reuse it/adapt it.


Anyone?
Plus, override the default serialization method, so the objects can't be changed via serialization.
17 years ago

Originally posted by Zkr Ryz:
Try using Jakarta Commons HTTPClient. Search in google: post xml HttpClient
It's quite easy.


17 years ago
Try using Jakarta Commons HTTPClient. Search in google: post xml HttpClient
It's quite easy.
17 years ago
Hello community.

Does anyone know how to consume a webservice running on WL8.1 with a jdk1.3 client. I've create the client using the cliengen ant task for the ws, how ever when I run it, it throws the following exception:
Exception: java.lang.NoSuchMethodError
at weblogic.xml.schema.binding.internal.TypeMappingEntryImpl.<init>(TypeMappingEntryImpl.java:61)
at weblogic.xml.schema.binding.internal.XSDTypeMapping.addEntries(XSDTypeMapping.java:812)
at weblogic.xml.schema.binding.internal.XSDTypeMapping.createPrimaryMapping(XSDTypeMapping.java:154)
at weblogic.xml.schema.binding.internal.XSDTypeMapping.createInstance(XSDTypeMapping.java:138)
at weblogic.xml.schema.binding.internal.XSDTypeMapping.<clinit>(XSDTypeMapping.java:118)
at weblogic.xml.schema.binding.internal.TypeMappingFactoryBase.createDefaultMapping(TypeMappingFactoryBase.java:18)
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegistry.java:100)
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegistry.java:32)
at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:88)
at client.mws.MiddlewareWS_Impl.<init>(MiddlewareWS_Impl.java:22)
...
...

I think this is parser related.

Has anyone a jdk1.3 ws client of any sort?

Thank you.
17 years ago
Did anyone find the solution for this?
Re-posting the question.
How can I use a weblogic8.1 webservice from a jdk1.3 client?

I think using the generated client is not useful since this exception is thrown. The only difference I have been able to identify is the jdk version.


Thanks a lot.
17 years ago
It looks like you are very close to the solution.
The ideas you have so far are the same I use to complete the requirement. Keep on the same track and tell us how did you finish you assignment.
18 years ago
Using reflection allows you to get knowledge about the classes loaded into a system in a highly dynamic way, the main benefit about using it would be that you can interact with classes that were not present at compile time. This is the good part. For example if you are building a Java to XML tool, you should necessary use reflection to get to know the classes you want to map ( by the time you build the tool, those classes might not even exists ).
But this power comes at a price:

Quoting Joshua Bloch 1:


You lose all the benefits of all compile-time checking.
The code required to perform reflective access is clumsy and verbose.
Performance suffers.

Reflection is used only at design time. As a rule, objects should not be accessed reflectively in normal applications at run time.


and continues:


Sophisticated applications, like class browsers, object inspectors, code analysis tools, and interpretive embedded systems demand the use of reflection.[...] If you have any doubts as to whether your application falls into one of these categories, it probably doesn't



But what to do if you need to interact with classes that does not exists by the time you create your code? the best way is to provide an interface that the new classes must implement. An example is the JDBC API. All java.sql.Connection, java.sql.PreparedStatement, java.sql.ResultSet and many others are interfaces. The database provider, implements these classes in its driver, thus allowing the programmer to access the database in a consistent way.

1 Joshua Bloch. Effective Java Programming Language Guide.
This is an excellent book.
[ February 24, 2006: Message edited by: Zkr Ryz ]
18 years ago
I guess I should watch the movie.
[ May 13, 2005: Message edited by: Zkr Ryz ]
Jeroen: What does "42" means in your signature.