Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

sriram viswanathan

Greenhorn
+ Follow
since Jul 27, 2007
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 sriram viswanathan

What is the best way to retain textbox focus when a validation fails?
Scenario: Txt1 and Txt2 are next to each other. Both are mandatory fields. When we write code in Txt1 onblur, it fires only after yielding focus to Txt2. This causes a problem because, when we do Txt1.focus from onblur, it fires the Txt2 onblur, which in turn requests focus, thus going into a deadlock situation.

To avoid this, had to go for a dirty flag as in the code snippet below.

Is there a better way? Are there any good events that will work in IE as well as Firefox?

Note: Also tried

return false

inside onblur. Dint work.



Thanks in advance,
Sriram
[ September 10, 2008: Message edited by: sriram viswanathan ]
Just wanted to confirm that the exception is not thrown when we stored it as suggested.
Mike,

Thanks for your suggestion.

Initially we tried it out this way because each of the threads could possibly use a different provider and they had to execute in parallel. We wanted to check if that worked initially by having different threads call this method with different provider names.

Still, we would have expected the code to work as it is. We still dont understand why this particular exception is thrown. I could have understood an out of memory kind of exception in case the operation is resource heavy.

Anyway, thanks for your suggestion. We will check by loading the different EntityManagerFactories in a map during application startup after initializing them and obtain the instances when required.
Below was the code we were using...it initializes an entity manager for us. It is similar to the solution suggested...but just that we do not close the entity manager


All the threads call this to obtain an entity manager instance.

Also, we are not at present working with different persistence providers for different threads...
but that will be our next level once we are through with the current problem. Based on your reply, we are worried that it may not be a sound approach.
Please advice.
Hi,
I apologize for the delay in response.

The way we packaged and deployed Toplink Essentials is as below
First try - without threading:
We have a business layer that is a web application. Data layer (incorporates the Toplink essentials functionality) is a jar file used as a lib file for the business layer application. We have a separate jar file that contains the entities and also the META-INF/persistence.xml file.
We deployed this in Tomcat server and the setup was working fine initially.

We had to make a change in the business layer like this:
Based on an input file, we spawn new threads.Each of these try to access the data layer in parallel.

In this setup too, if we configure the input file to use only one Toplink operation, it works fine.

But when multiple operations are configured, results in the above exception.
Also, not all the operations fail.

Eg- Input
Insert1 Success
Update1 Success
Delete1 Success

Insert1,Update1,Delete1 - Insert and delete are successes but update fails.
Hi,



I earler successfully tried out Toplink deployed in Tomcat from simple web application.
But now, we are required to invoke it from multiple threads. This time around we are getting the below exception:

Toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: Attempted to deploy PersistenceUnit [PersistenceProv1] for which predeploy method eit
her had not called or had failed



Toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: Attempted to deploy PersistenceUnit [PersistenceProv1] for which predeploy method eit
her had not called or had failed
[TopLink Config]: 2007.08.16 02:42:07.076--ServerSession(7654146)--The alias name for the entity class [class com.abc.apps.entity.MyTable1] is being defaulted to: MyTable1.
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:195)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.
java:84)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFacto
ryImpl.java:127)
at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFacto
ryImpl.java:121)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.ja
va:76)
at com.abc.apps.dao.businessInterface.DataLayerUtils.getEntityManager(DataLayerUtils.java:27)
at com.abc.apps.dao.businessInterface.fetchByPrimaryKey(DataLayerInterfaceImpl.j
ava:93)
at com.abc.apps.business.task.EntityRemoveHandler.process(EntityRemoveHandler.java:100)
at com.iii.apps.tahoe.business.task.Threading.run(ThreadingWay.java:42)
at java.lang.Thread.run(Thread.java:619)
Caused by: Exception [TOPLINK-28013] (Oracle TopLink Essentials - 2006.7 (Build 060720)): oracle.toplink.essentials.exceptions.
EntityManagerSetupException
Exception Description: Attempted to deploy PersistenceUnit [PersistenceProv1] for which predeploy method eit
her had not called or had failed
at oracle.toplink.essentials.exceptions.EntityManagerSetupException.cannotDeployWithoutPredeploy(EntityManagerSetupExce
ption.java:167)
... 10 more

Can someone please suggest what needs to be done for this.
Any help is appreciated.

Originally posted by Vassili Vladimir:
Hi,

I have a table with a DATE field which i want insert the current date into, is there a way to insert the current date with the following format : dd-mm-yyy as and example 03-08-2007 using sysdate ?

Thanks in advance ...





Oracle uses a specific format for internal storage (RR date format). When a DATE is instantiated, it represents a day(say Jan 1 2004) ... the formats are applicable only when we want to represent this date in different ways. The way it is stored in the database is always the same.

Eg -While selecting data , we can use to_char function to get it in the dd-mm-yyyy format as shown below


Hope this helps
16 years ago

Originally posted by Karan Jain:
Hi,
I am try to use XMLType in my oracle database ( Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production).

Do any body have any good tutorial/Code example for inserting/Retrieving data from XMLType?

Thanks...
Karan

[ July 30, 2007: Message edited by: Karan Jain ]


OTN Sample code Hope this link helps
16 years ago
Hi,
1Z0-042 is the DBA track, and the information in the following link OTN Site for certification suggests that only a working knowledge of Sql is required. However, in my opinion, to be a good Oracle DBA, its best to have a good working knowledge of SQL, PL/SQL too
Hope This Helps
[ August 02, 2007: Message edited by: sriram chandra mouli viswanathan ]
16 years ago
Possible Solution:
There is a way we can change the sdk used by oc4j from the Application Server Control application, make "Java Executable" value as the required sdk executable path.

Word of caution:
OAS 10.1.2 is certified only for sun sdk 1.4 and we are strongly recommended to adhere to certified versions, since those are the ones that are tested thoroughly. For this reason, we are not going for a sdk upgrade.

Thanks for your help though
16 years ago

Originally posted by Ulf Dittmer:

The next 4 bytes after CAFEBABE contain the minor and major version of the class file format. For Java 5, it would be "00 00 00 31", with the "31" being hexadecimal for "49".



Thank you so much for the help ... My next task is to try and figure out a way to make the Oracle Application Server (OC4J 10.1.2) to use the Sun JDK 1.5 instead of the SDK bundled with OAS
16 years ago
Hi,
I am also faced with a similar problem in 10g App Server
java.lang.UnsupportedClassVersionError: abc/xyz/thirdpartyclass (Unsupported major.minor version 49.0)at java.lang.ClassLoader.defineClass0(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:539)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.OC4JSecureClassLoader.defineClassEntry(OC4JSecureClassLoader.java:172)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].naming.ContextClassLoader.defineClass(ContextClassLoader.java:1179)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].naming.ContextClassLoader.defineClass(ContextClassLoader.java:1065)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].naming.ContextClassLoader.findClass(ContextClassLoader.java:404)at java.lang.ClassLoader.loadClass(ClassLoader.java:289)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].naming.ContextClassLoader.loadClass(ContextClassLoader.java:143)at java.lang.ClassLoader.loadClass(ClassLoader.java:235)at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)at com.iii.premia.interfaces.solvese.InterfaceImplPremiaSolve.getInitialisedSolveLink(InterfaceImplPremiaSolve.java:423)at com.iii.premia.interfaces.solvese.InterfaceImplPremiaSolve.callCenterPayment(InterfaceImplPremiaSolve.java:256)at com.iii.premia.interfaces.solvese.__InterfaceImplPremiaSolveStatelessWrapper.invokeMethod(__InterfaceImplPremiaSolveStatelessWrapper.java:130)at oracle.j2ee.ws.InvocationWrapper.invoke(InvocationWrapper.java:380)at oracle.j2ee.ws.RpcWebService.doGetRequest(RpcWebService.java:642)at oracle.j2ee.ws.BaseWebService.doGet(BaseWebService.java:1173)at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:792)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)at java.lang.Thread.run(Thread.java:534)

Most of the reference materials/forums suggest recompiling the class in a lower version of java...but unfortunately that is not an option, since it is a third party utility class.

It will be greatif anyone can suggest ways of :
  • Changing the JVM used by the 10g appserver 10.1.2 to Sun JDK 1.5
  • Setting 1.4 as the target level of (possibly obfuscated) java class files without having access to source files
  • Identifying the java version of class file (I tried to read the version information in Hexadecimal after CAFEBABE marker... but unable to makeout anything from it)
  • Could the jar utility version used be a problem (if not the actual class)?


  • [ July 27, 2007: Message edited by: sriram chandra mouli viswanathan ]
    16 years ago