Akshay Bondre

Greenhorn
+ Follow
since Sep 04, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Akshay Bondre

Mohamed Sanaulla wrote:Cross posted on stackoverflow. Please BeForthrightWhenCrossPostingToOtherSites



I wasn't aware of this. Apologies to people who do get offended by cross posting.
I do believe that different set of people visit different forums and hence my intent while cross posting was only to get a quick reply.

A topic regarding the same doubt has been created at the following link too :

http://stackoverflow.com/questions/9156712/finding-timestamp-pattern-from-a-string
12 years ago
I want to convert a String into Timestamp, the pattern for which is unknown. Is there any API given by java which allows us to feed in the string and returns the possible patterns that could work with it? I understand that one could have some pre-defined patterns against which the String can be parsed and checked. But, since this is a timestamp, the number combinations of different dates and times will be quite a lot. So, was looking for an efficient way of figuring out the pattern of the String-Timestamp.
12 years ago

Arun Kumarr wrote:Did you consider the possibility that the Character filed value either in database or in your code can be null?



Yes, I checked the values just before the DTO is passed to "getSqlMapClientTemplate().insert", and the value is always there.

To top it all, it works fine when the same EAR is deployed on JBoss instead od websphere, pointing to same database in either case,
@ Wouter Oet :

Ok, I just thought of bouncing this topic so that it is seen by someone who may be able to suggest something.

Thanks.
Hello,

I am using Ibatis to fire queries to DB2. Server is Websphere 7.0.0.9

I have a field which has to be converted in bytes and inserted into a CHARACTER column whose length is 16.

In the code I do the following,

String str = "123";
str = str.getBytes().toString();

I set this "str" in one of the objects which are mapped in the "sql.xml" file.

My mapping for this particular field is as follows :

parameter property="idOper" jdbcType="CHARACTER" javaType="java.lang.String";

Now, when I execute the code, it runs fine for the first time, but when I run it one more time, it gives me an exception that it is not able to convert String into byte[].

The exception block is as follows :


Convert invalid: Unable to convert from "java.lang.String" to "byte []" ErrorCode =- 4474, SQLSTATE = null; com.ibatis.common.jdbc.exception.NestedSQLException nested exception is:


Any help, pointers, observations would be much appreciated.

Thanks,
akkyy

Originally posted by Keith Harrison:


Problem sorted.

solution: By default fragment files were not mapped.




What exactly do you mean by fragment files were not mapped? .. I am getting the same exception.
15 years ago
JSP
As of now, once the structures are fetched, they are kept in memory for users to use and modify often.

I was successful to design a class structure that comprises of this data. The structure reads the data the way I want it to and also saves it + I get data that I want by simply calling the accessors on those classes. Everything is wonderful, just for this session management thingie.

If I read the object initially and keep it in my Web Session, would I be able to fetch the lazy data? I think I would need a Hibernate session and update that object before I ask something out of it. Or not?
Ok.

My main intention was to fill up some base structures of the product using Hibernate on the login. But, now I realized, I cannot read an object structure through Hibernate and keep it ready to use for the user.

The lazy fetched data isn't available once i close the session. And I cant possible keep one session alive through out the life of a user login so that the object(structure) read can be traversed to access information.
I am trying to use EHCHACHE. But, not able to get updated data across sessions.

I tried following..
> Using "getSessionFactory.getCurrentSession()"
In this case, I need to start a transaction and commit it. If I further close the session then I get the updated attributes across sessions which are direct attributes of the class but not the lazily fetched.([sets])

> Using "getSessionFactory.openSession()"
I dont need to open transactions and close them all the time, + the lazy data is available through out the object life. But, in this case, the data is not being updated across the sessions.

Help!
Oh ok, my bad.

We use JSP's & Servlets as web container. There is no rigid framework followed though.
We follow the MVC architecture. Nope, no transaction manager or containers.
We are planning to start using Hibernate in our browser based Enterprise Application. We are trying to implement it on a small part of our core structures to see how feasible it would be for us to use on the legacy code and database. Few queries regarding the same..

Intitially we wanted to keep one transaction open for all the read operations and keep on opening and closing other transactions for write operations (Since it needs a commit). But, it seems we cant keep two transactions open on the same session. So, we tried opening a new session for write operations, but again we cannot share the dettached object read from session 1 (which is still open) and save it through session 2.

I could read a obj from session 1, detach it by committing the transaction on session 1 and then reuse the object on session 2 by updating it. But, this would mean lot of sessions/transactions opening and closing.

Any suggestions on the basic design or path way to implement hibernate on the existing code?

Would hibernate 3.3 be of any help?