Isolation level 0 and java persistence frameworks
Hi,
i use www.castor.org as my persistence framework, castor have have its own lock engine and cache for entities, then i think to avoid some table lock in database to pass for JDBC connection the parameter isolation=0, as any update or write is made and controlled by castor in castor i dont have dirty data, anyone have experience with any other java persistence engine and used maxdb with lock engine managed by framework?
any insight about this are welcome.
best regards
Clóvis
> Hi,
>
> i use www.castor.org as my persistence framework, castor have have its own lock engine and cache for entities, then i think to avoid some table lock in database to pass for JDBC connection the parameter isolation=0, as any update or write is made and controlled by castor in castor i dont have dirty data, anyone have experience with any other java persistence engine and used maxdb with lock engine managed by framework?
>
Sure
The whole SAP NetWeaver stack runs with isolation level 0.
Works quite fine.
In fact there are certain features (like the count(*) optimization) that don't work consistently with isolation level 1 (read commited).
So you shouldn't get into trouble with that.
regards,
Lars
Similar Messages
-
DAO pattern and Java Persistence API
Hi
This is a question for anyone who might be familiar with the standard DAO design pattern and the Java Persistence API (JPA - part of EJB3). I'm new to this technology, so apologies for any terminology aberrations.
I am developing the overall architecture for an enterprise system. I intend to use the DAO pattern as the conceptual basis for all data access - this data will reside in a number of forms (e.g. RDBMS, flat file). In the specific case of the RDBMS, I intend to use JPA. My understanding of JPA is that it does/can support the DAO concept, but I'm struggling to get my head around how the two ideas (can be made to) relate to each other.
For example, the DAO pattern is all about how business objects, data access objects, data transfer objects, data sources, etc relate to each other; JPA is all about entities and persistence units/contexts relate to each other. Further, JPA uses ORM, which is not a DAO concept.
So, to summarise - can DAO and JPA work together and if so how?
Thanks
P.S. Please let me know if you think this topic would be more visible in another forum (e.g. EJB).Thanks, duffymo, that makes sense. However ... having read through numerous threads in which you voice your opinion of the DAO World According to Sun, I'd be interested to know your thoughts on the following ...
Basically, I'm in the process of proposing an enterprise system architecture, which will use DAO as the primary persistence abstraction, and DAO + JPA in the particular case of persistence to a RDBMS. In doing so, I'd like to illustrate the various elements of the DAO pattern, a la the standard class diagram that relates BusinessObject / DataAccessObject / DataSource / TransferObject (http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html). With reference to this model, I know that you have a view on the concept of TransferObject (aka ValueObject?) - how would you depict the DAO pattern in its most generic form? Or is the concept of a generic DAO pattern compromised by the specific implementation that is used (in this case JPA)? -
Object, Query and Java Persistence API
Hello Java Programmers.
Question to Object handling with Query results and evaluation.
Example:
one table with 3 Columns
Tablename = ISO6933
Column 1 = UID
Column 2 = language name
Column 3 = language long name
data in database:
C1 = 1
C2 = "ger"
C3 = "german"
read the data from database with EntityManagerFactory and EntityManager
Query query = em.createNativeQuery("SELECT * FROM ISO6933");Final to - Query (Persistence) to Choice (AWT)
Search short code for example!
query.setFirstResult(0); // first element -> possible?
java.util.List queryList = query.getResultList();
// warnings -> List is a raw type. References to generic type List<E> should be parameterized
java.awt.List list = new List();
list.add(queryList.toString()); // for one element in the result, for more elements for/next loop
// = [1,ger,german]I do not want to use
- StringTokenizer
- String.split
(Cast from java.util.List to java.awt.List = Type mismatch: cannot convert from List to List)
for one elements from [1,ger,german]
final to
1
ger
german
in the AWT List()no answer? = is an answer !
the normal solution would be for example.
Query query = em.createNativeQuery("SELECT * FROM ISO693_3"); // create query
query.setFirstResult(0); // first element
Object[] objectList = query.getResultList().toArray();
// objectList[X] = UID,LANGUAGE_ID,LANGUAGE_NAME
int intLength = objectList.length; // Length
StringTokenizer token; // parser
String string = new String(); // temp
for (int i1=0;i1<intLength;i1++)
string = objectList[i1].toString();
string = string.substring(1, string.length()-1);
token = new StringTokenizer(string, ",");
while (token.hasMoreElements())
list.add(token.nextToken().trim()); // the next element and clean string
}I look for however a better solution!
Best greetings -
Oracle XA driver and isolation level
We have an Entity EJB that has isolation level specified in its
deployment descriptor and everything works fine if we use the non-XA
Oracle 9i driver.
However when we use the Oracle 9i Release 2 XA driver we get the
following exception:
java.sql.SQLException: Due to vendor limitations, setting transaction
isolation for "Oracle 8.1.7 XA" JDBC XA driver is not supported.
at
weblogic.jdbc.jta.DataSource.setTxIsolationFromTxProp(DataSource.java:1126)
at
weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1109)
at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:145)
at weblogic.jdbc.jta.Connection.getAutoCommit(Connection.java:247)
at
weblogic.jdbc.rmi.internal.ConnectionImpl.getAutoCommit(ConnectionImpl.java:173)
at
weblogic.jdbc.rmi.SerialConnection.getAutoCommit(SerialConnection.java:164)
Note the 8.1.7 version that the container prints. The driver is
definitely 9i and not 8.1.7 and it's the very first thing in the classpath.
Is this a problem with the driver really or is it a WLS issue?
Thanks,
DejanHi,
I removed the transaction isolation level setting from the deployment
descriptor and it works now as expected.
But in the meanwhile I also ran a test by using the driver directly
without Weblogic and I was able to successfully set the transaction
isolation level on the XA connections so I believe it's a Weblogic problem.
Dejan
Deyan D. Bektchiev wrote:
Yes,
We know about this but we just try to set it to the default one
(READ_COMMITED) which is probably redundant for Oracle but might not
be the default one for another DB vendor.
Here is the part of the deployment descriptor:
<transaction-isolation>
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
<method>
<ejb-name>Event</ejb-name>
<method-name>*</method-name>
</method>
</transaction-isolation>
Dejan
Slava Imeshev wrote:
Deyan,
I'm not 100% sure, but AFAIR oracle doesn't support all isolation
levels.
Which level do you set? Could you show us this part of the deployment
descriptor?
Slava
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
Thanks for the reply Sree,
Yes the 9i driver is the very first thing in the classpath as otherwise
we wouldn't even be able to connect to the 9i database with the 8.1.7
driver (we were getting lots of other exceptions when we were still
using the 8.1.7 driver).
I'll try removing the setting of the isolation level and I'll post the
result to the newsgroup.
Dejan
Sree Bodapati wrote:
hi Deyan,
java.sql.SQLException: Due to vendor limitations, setting
transaction
isolation for "Oracle 8.1.7 XA" JDBC XA driver is not supported.
should not have showed up with wrong version of oracle. If you can
verifiy
that the thin driver is the first thing in the classpath and you are
indeed
using the thin driver, This is a bug.
But in this case it looks like you need to remove the
TransactionIsolation
level from the EJB descriptor to get this to work. can you try that? I
will
forward this to one of our EJB engineers and see if we can get some
help
for
you.
sree
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
Sree,
We already did but the only answer we got was that the Oracle 9i
Release
2 driver was not at all supported by Weblogic 7.0 SP1.
But the certification page says that it is even certified...
So which one is true: The Oracle 9i Release 2 driver is not
supported or
is supported?
--dejan
Sree Bodapati wrote:
Please file a support case for this at [email protected]
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
We have an Entity EJB that has isolation level specified in its
deployment descriptor and everything works fine if we use the
non-XA
Oracle 9i driver.
However when we use the Oracle 9i Release 2 XA driver we get the
following exception:
java.sql.SQLException: Due to vendor limitations, setting
transaction
isolation for "Oracle 8.1.7 XA" JDBC XA driver is not supported.
at
weblogic.jdbc.jta.DataSource.setTxIsolationFromTxProp(DataSource.java:1126
at
weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1109)
at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:145)
at
weblogic.jdbc.jta.Connection.getAutoCommit(Connection.java:247)
at
weblogic.jdbc.rmi.internal.ConnectionImpl.getAutoCommit(ConnectionImpl.jav
a
>
173)
at
weblogic.jdbc.rmi.SerialConnection.getAutoCommit(SerialConnection.java:164
Note the 8.1.7 version that the container prints. The driver is
definitely 9i and not 8.1.7 and it's the very first thing in the
classpath.
Is this a problem with the driver really or is it a WLS issue?
Thanks,
Dejan -
Jdbc mysql "select ... for update" and isolation level...
Dear, I am now writing an application, in which some worker threads will get a waiting job from database (mysql) and perform the processing.
To avoid workers getting the same job id, I have studied the topics about locks, isolation level, and something like "select ... for update".
The storage engine being used is innoDB. Actually the problem seems solved after using "select ... for update" to get the id, but I am just curious that do I also need to care about the isolation level. It is because when I do some experiments by setting the isolation level to serializable, but NOT using "SELECT ... FOR UPDATE" (just simple select), exception something like "deadlock found and try to restart transaction" occurs. Is there any relationship between these two things? Any comments are welcome!! Thanks!!!ashipj wrote:
can u plz provide me with the code (connection string). Am new to Mysql.
And also the driver u are using.
Thank youDon't hijack other's topics. Kindly start your own. Don't do that before you read the [Sun JDBC tutorial|http://java.sun.com/docs/books/tutorial/jdbc/index.html] and the [MySQL JDBC documentation|http://dev.mysql.com/doc/refman/5.0/en/connector-j.html]. -
Hello,
I'm new to the Oracle environment and have just started using PL/SQL on Oracle 8i. Where can I find info on how Oracle locks data and how transaction isolation levels are used? We've still not recvd our manuals so please any replies referring to manuals are not welcome!You could move forward balance into its own table. That was, the SELECT will not lock on the original table. Most of the running balance schemes that I have seen take a snapshot as of a given date (say, statement printing date) and record both the timestamp and the amount. Next month, you simply get last month's vaule and timestamp and query on transactions after that timestamp.
- Saish -
Hi,
In mssql i am using following things.
I have two database D1 and D2, i am using snapshot isolation (ALTER DATABASE MyDatabase
SET ALLOW_SNAPSHOT_ISOLATION ON) in both database.
Following is the situation.
1) There is one SP sp1 ( it can be in any database d1 or d2), it updates d2 from d1.
2) d2 is used for reading by web, execept above SP sp1
3) d1 gets updation from web in readcommite isolation.
4) both database will be on same instence of mssql.
Q1) wanted to know how to implement the same thing in oracle 11x express edition.
Q2) is there any diffrence between snapshot isolation level of mssql and oracel.
any link would be help full.
yours sincerely>Q1) should i set the option to OFF after the process(ts) is complete
No keep it on.
>Q2) ALLOW_SNAPSHOT_ISOLATION ON , will affect other isolation level's transactions
No it will not affect any other transaction isolation level.
>Q3) is my choice of isolation level for process(ts) is correct or there can be any other solution.
Seems fine, although there are probably many other solutions.
David
David http://blogs.msdn.com/b/dbrowne/ -
Java Persistence API and creation of databases
Hi All
I have designed a small address book application which uses a database to store the information. I have used the new Java Persistence API to take care of my transactions and querrys with the database. This works great for one set database which is generated the first time the application runs and is used all the time.
However I would like to make it so that the user can create a new address book (database) with a different name, I am not sure how I would do this using the Java Persistence API. I know the persistence.xml file must be placed in the META-INF directory of the source, so how would I be able manipulate the file or could I place the file somewhere else.
DavidI am using the Derby database. I can create a database by passing the create command when I create the entity Manager like so:
Connection c = DriverManager.getConnection("jdbc:derby:AddressBook;create=true", "app", "app");My problem is that as I understand it the persistence.xml file must know the name of the database. Unless there is another way of setting this. The line in the persistence file I am referring to is:
<property name="toplink.jdbc.url" value="jdbc:derby:AddressBook"/>I wonder if I can progamatically set this value so that I have a default database in the persistence.xml and others can then create there own.
David -
Just read "Best of Macworld" article "How to disable Java on your Mac," in email dated 2/25/13. I'm a dinosaur running OS 10.4.11 and Java 1.5.0_19, which is earlier than the versions addressed in the article. Do I remove/isolate in the same manner? Will the effects of removal/isolation the same as described in the article?
Hello, if you're talking about disabling Java in say Safari...
Safari>Preferences>Security>uncheck/Disable Java in your Browser settings, not JavaScript. -
Hi,
I have a portal installed on a standalone java based on sp13. I also have a backend ECC5.0 on a web as abap (sp9). If I want to connect the portal to the backend ecc, do I need to upgrade the abap to the same patch level as the standalone java (ie. sp13).
Also, I have installed the portal via rapid installer, which has also created a new sld for me. If I want to add the abap as a new technical system in the sld, is it required that both the java (of which the sld is based) and the abap be of the same patch level? thanks!Hi,
If you want to connect to the backend system , both the Portal and ECC (Back end System ) need not be of the same pacth level. And you can also add the techincal system in SLD of diffrent pacth levels.
Thanks,
Tanuj -
I know c,c++ and java language ! and i want to contribute for development of mozilla products ! any idea where i can find beginner level projects ! so that i can hone some real development skills too :)
You could also try jumping in on some of the Mozilla IRC chat channels as was suggested to someone else in another thread.
Also you could also try the [/forums/buddies new contributors forum], it does now have an Admin monitoring and replying. (At the time of the quoted post Admins were almost impossible to get hold of for forum matters )
''Noah_SUMO [/forums/buddies/710569#post-61671 said]''
<blockquote>
Sorry I didn't see this earlier. :)
I know just the places where I think you'd fit in best. To make sure, just join us in #sumodev and #mozwebqa and #communityit at irc://irc.mozilla.org
I think your skills in php, javascript, python and server admin-y stuff will come in real handy at these places. :D
For example, some help is needed here to fix these tests after a new theme was added to wiki.mozilla.org and they are in python. https://github.com/mozilla/wiki-tests - more info in #mozwebqa
And maybe some help with perl might be needed with firebot, a irc bot written in perl. Channel #firebot for that.
And #communityit (for server admin stuff) and #sumodev could use some help as well, just pop in and ask. :)
</blockquote>
Also see
* [[Contributor News & Resources#w_communication-channels]]_communication-channels
** Mibbit link (this one for #sumo channel ) https://www.mibbit.com/?server=irc.mozilla.org&channel=%23sumo
P.S. and see
* https://wiki.mozilla.org/Good_first_bug -
Transaction Isolation level in WebSphere and JBOSS???
Hi,
How to set up the transaction isolation level in Websphere and JBOSS???
In weblogic, we can set it in weblogic-ejb-jar.xml. Is there any other file where we can set the isolation level in websphere and jboss???
What is the difference between all the 4 isolation levels such as
1) Transaction_committed
2) Transaction_uncommitted
3)Transaction_Repeatable_read
4)Transaction_serializable
Thanks,
JavaCrazyLoverIn WebSphere 5.1 you can set the isolation level using resource reference. The following link describes the steps involved in this operation. I am not aware how to do the same thing in JBoss.
Regards,
Neo -
XA and SERIALIZABLE isolation level
Hi,
I'm using JDBC with oracle DB 8.1.6. When I get the physical connection and set transaction isolation level to TRANSACTION_SERIALIZABLE then issue start() on the XAResource instance it gives me error number 24776 "cannot start a new transaction". Without setting isolation level, the transaction would go smoothly. Note that this is the only transaction I have in my small test program. You can test it with the example given in oracle documentation.Hi,
I'm using JDBC with oracle DB 8.1.6. When I get the physical connection and set transaction isolation level to TRANSACTION_SERIALIZABLE then issue start() on the XAResource instance it gives me error number 24776 "cannot start a new transaction". Without setting isolation level, the transaction would go smoothly. Note that this is the only transaction I have in my small test program. You can test it with the example given in oracle documentation. i don't think you are allowed to set transaction isolation level to Serializable for XA -
Level of Knowledge in ABAP and Java?
Hi All,
I am seeking a career in SAP Netweaver Process Integration - XI and would like to know what level of knowledge would i need to have in ABAP and Java. If i should have any what are the area's that would be expected. Please Clarify.
Your advice will be greatly appreciated.
Thank You,
Ajay C Indukuru.Hi Ajay
in addition to chirag's comment
We use ABAP Proxies in case of we are dealing with the ABAP Based Applications
We use JAVA Proxies in case of we are dealing with the JAVA based application
in SAP XI We have two ways of connectivity
1) adapter
2)proxy
in applications based on WAS 6.20 or above we can directly communicate to XI through Proxies
while application based on below WAS 6.20 you have to use adaptyer to communicate to XI
proxies seperate business application logic from the integration logic of integration logic
proxy generation converts non language specific interface description in WSDL into executable interface
Java proxy is generated from the WSDL description opf interface and this is generated as a JAR file in IR
while ABAP proxy is generated by transaction SPROXY
on Application server based on WSDL description of message interface
PROXIES have same mode and direction as Interfaces have
To learn Java you should know only basic concepts of java means you must have basic java programmin skill
Java proxy can be generated through wizard also this is an inbuild functionality of SAP XI
to lear java follow this link
java.sun.com/docs/books/tutorial/
To learn ABAP you should know beginner level ABAP4GL
ABAP is very simple language and coding is like that you are writing simple english sentence so you would be feeling comfortable withABAP with a little practice
GO to T CODE se24 and start developing
learn ABAP with this link
http://www.itquestionbank.com/sams-teach-yourself-abap-4-in-21-days.html
for more advance version you may follow SDN
in my opinion nothing is so hard to learn
i hope this may assist you
if helpful kindly reward points
Regards
Sandeep Sharma -
Isolation level and performance impact?
Hi
I'm new to BDB JE and building some prototypes to evaluate it.
Given a simple usecase of storing the following key/value pair <String,List<Event>> mapping a user to his/her list of events, in the db. New events are added for the user, this happens (although fairly rarely) concurrently.
Using Serializable isolation will prevent any corruption to the list of events, since the events are effectively added serially to the user. I was wondering:
1. if there are any lesser levels of isolation that would still be adequate
2. using Serializable isolation, is there a performance impact on updating users non concurrently (ie there's no lock contention since for the majority of cases concurrent updates won't happen) vs the default isolation level?
3. building on 2. is there performance impact (other than obtaining and releasing locks) on using transactions with X isolation during updates of existing entries if there are no lock contention (ie, no concurrent updates) vs not using transactions at all?
Thanks!
PeterHave you seen this section of the Getting Started Guide on isolation levels in JE? http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/isolation.html
Our default is Repeatable Read, and that could be sufficient for your application depending on your access patterns, and the semantic sense of the items in your list. I think you're saying that the data portion of a record is the list of events itself. With RepeatableRead, you'll always see only committed data, and retrieving that record from a JE database will always return a consistent view of a given list. See http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/isolation.html#serializable for an explanation of what additional guarantee you get with Serializable.
2. using Serializable isolation, is there a
performance impact on updating users non concurrently
(ie there's no lock contention since for the majority
of cases concurrent updates won't happen) vs the
default isolation level?Yes, there is an additional cost. When using Serializable isolation, additional locks are taken on adjacent data records. In addition to the cost of acquiring the lock (which would be low in a non-contention case), there may be additional I/O needed to fetch adjacent data records.
3. building on 2. is there performance impact (other
than obtaining and releasing locks) on using
transactions with X isolation during updates of
existing entries if there are no lock contention (ie,
no concurrent updates) vs not using transactions at
all? In (2) we compared the cost of Serializable to RepeatableRead. In (3), we're comparing the cost of non-transactional access to the default Repeatable Read transaction.
Non-transactional is always a bit cheaper, even if there is no lock contention. On top of the cost of acquiring the locks, non-transactional operations use less memory and disk space, and execute some transaction setup and teardown code. If there are concurrent operations, even in there is no contention on a given lock, there could be some stress on the lock table latches and transaction tables. That said, if your application is I/O bound, the cpu differences between non-txnal and txnal operations becomes more of a secondary factor. If you're I/O bound, the memory and disk space overhead does matter, because the cache is more efficiently used with non-txnal operations.
Regards,
Linda
>
Thanks!
Peter
Maybe you are looking for
-
WAR file fails to deploy WEB-INF/classes
Hi All I am attempting to get a simple JPA on JSE app running on WLS 9.1. I can deploy my WAR file and access the jsps no problem, however the WEB-INF/classes directory is empty on deployment. How can I tell if the classes are being deployed correctl
-
Error using XSQL to generate RSS feeds on Unix
I`m using an XSQL file used with a stylesheet to render an RSS 2.0 feed. RSS readers can pick the feed up successfully when I used a Windows based Oracle Application server installation but not when it was migrated to a Unix based server. Both server
-
Auto create Opportunity record
Hi all, I have a requirement when there is a new Lead record created, I want to trigger a workflow to auto create the Opportunity attach to the Lead? Can this be done in CRMOD? If yes, can I know how to do it? Thanks in advance.
-
Photoshop CS6 and OS Mavericks Issue
I can't get photoshop cs6 to behave properly now that I've upgraded to OS Mavericks. For that matter - I can't get InDesign or Illustrator CS6 to behave properly either. When I use the File Open, File Save, and File Save As commands I immediately ge
-
How do I sync ipad to new mac (from PC)?
I am moving from a PC to a Mac, How do I sync to itunes when ipad is already linked to another PC?